gl_BoundingBox - OpenGL ES 3.2 Reference Pages

## Name

gl_BoundingBox — contains the bounding box primitives generated from the output patch

## Declaration

`patch out mediump vec4 gl_BoundingBox[2] ;`

## Description

`gl_BoundingBox[]` is an array of two vec4 values that should be used instead of the value of `GL_PRIMITIVE_BOUNDING_BOX` as the primitive bounding box (see glPrimitiveBoundingBox) for primitives generated from the output patch. `gl_BoundingBox[]` is consumed by the tessellation primitive generator, and is not available as an input to the tessellation evaluation shader.

## Notes

If tessellation is active, each invocation of the tessellation control shader may re-specify the bounding box by writing to the built-in `gl_BoundingBox[]` variable. If the shader statically assigns a value to any part of this variable, then `gl_BoundingBox[]` is used instead of the parameters to `glPrimitiveBoundingBox`. If the shader contains a static assignment to `gl_BoundingBox[]` and there is an execution path through the shader that does not write all components of `gl_BoundingBox[]`, the value of unwritten components and corresponding bounding box coordinates is undefined for executions of the shader that take that path.

If the tessellation control shader re-specifies the bounding box, the re-specified value is used for primitives generated from the output patch by the primitive generator, any primitives emitted by the geometry shader invocations for those generated primitives, and any primitives further introduced during clipping.

## Version Support

| OpenGL ES Shading Language Version
--- | ---
Variable Name | 1.00 | 3.00 | 3.10 | 3.20
gl_BoundingBox[] | - | - | - | ✔

## See Also

glPrimitiveBoundingBox

## Copyright

Copyright © 2015 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.