GLSL: Fix tessellation control shader bounding box support. (#1730)

Prior to this change, OES_primitive_bounding_box and EXT_primitive_bounding_box were both recognised as extensions, but only the name gl_BoundingBoxOES could be used. However the EXT version uses the name gl_BoundingBoxEXT instead. In addition, since GLES 3.2, the extension has been included in the core standard and the name gl_BoundingBox may be used instead. This change aims to make both extensions and the 3.2 core version all work.
This commit is contained in:
Laurie 2019-03-19 01:49:27 +00:00 committed by John Kessenich
parent bd0f5ad278
commit e442a03897
5 changed files with 326 additions and 197 deletions

View file

@ -118,9 +118,20 @@ void goodfoop()
void bb()
{
gl_BoundingBoxOES[0] = vec4(0.0);
gl_BoundingBoxOES[1] = vec4(1.0);
gl_BoundingBoxOES[2] = vec4(2.0); // ERROR, overflow
gl_BoundingBoxEXT[0] = vec4(0.0); // ERROR without GL_EXT_primitive_bounding_box
gl_BoundingBoxOES[0] = vec4(0.0); // ERROR without GL_OES_primitive_bounding_box
gl_BoundingBox[0] = vec4(1.0);
gl_BoundingBox[1] = vec4(1.0);
gl_BoundingBox[2] = vec4(2.0); // ERROR, overflow
}
#extension GL_EXT_primitive_bounding_box : enable
#extension GL_OES_primitive_bounding_box : enable
void bbext()
{
gl_BoundingBoxEXT[1] = vec4(0.0);
gl_BoundingBoxOES[1] = vec4(0.0);
}
out patch badpatchBName { // ERROR, array size required