From 699684180f392efb893548dfb11b1b931013342e Mon Sep 17 00:00:00 2001 From: John Kessenich <cepheus@frii.com> Date: Wed, 13 Aug 2014 06:37:59 +0000 Subject: [PATCH] Implement cull distances for GLSL 4.5 (but not as an extension yet, just a 4.5 feature). git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27714 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- StandAlone/StandAlone.cpp | 6 ++ Test/450.comp | 1 + Test/450.frag | 3 + Test/450.geom | 14 +++++ Test/450.tesc | 14 +++++ Test/450.tese | 14 +++++ Test/450.vert | 10 +++ Test/baseResults/450.comp.out | 18 ++++++ Test/baseResults/450.frag.out | 26 ++++++++ Test/baseResults/450.geom.out | 72 ++++++++++++++++++++++ Test/baseResults/450.tesc.out | 70 +++++++++++++++++++++ Test/baseResults/450.tese.out | 68 ++++++++++++++++++++ Test/baseResults/450.vert.out | 47 ++++++++++++++ Test/baseResults/test.conf | 2 + Test/testlist | 5 ++ glslang/Include/ResourceLimits.h | 2 + glslang/MachineIndependent/Initialize.cpp | 35 ++++++++++- glslang/MachineIndependent/ParseHelper.cpp | 1 + glslang/MachineIndependent/Versions.cpp | 8 ++- glslang/MachineIndependent/Versions.h | 1 + 20 files changed, 414 insertions(+), 3 deletions(-) create mode 100644 Test/450.comp create mode 100644 Test/450.geom create mode 100644 Test/450.tesc create mode 100644 Test/450.tese create mode 100644 Test/450.vert create mode 100644 Test/baseResults/450.comp.out create mode 100644 Test/baseResults/450.geom.out create mode 100644 Test/baseResults/450.tesc.out create mode 100644 Test/baseResults/450.tese.out create mode 100644 Test/baseResults/450.vert.out diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index b16f139a9..9174b135f 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -197,6 +197,8 @@ const char* DefaultConfig = "MaxAtomicCounterBufferSize 16384\n" "MaxTransformFeedbackBuffers 4\n" "MaxTransformFeedbackInterleavedComponents 64\n" + "MaxCullDistances 8\n" + "MaxCombinedClipAndCullDistances 8\n" "nonInductiveForLoops 1\n" "whileLoops 1\n" @@ -401,6 +403,10 @@ void ProcessConfigFile() Resources.maxTransformFeedbackBuffers = value; else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0) Resources.maxTransformFeedbackInterleavedComponents = value; + else if (strcmp(token, "MaxCullDistances") == 0) + Resources.maxCullDistances = value; + else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0) + Resources.maxCombinedClipAndCullDistances = value; else if (strcmp(token, "nonInductiveForLoops") == 0) Resources.limits.nonInductiveForLoops = (value != 0); diff --git a/Test/450.comp b/Test/450.comp new file mode 100644 index 000000000..7f723ec0f --- /dev/null +++ b/Test/450.comp @@ -0,0 +1 @@ +#version 450 core diff --git a/Test/450.frag b/Test/450.frag index 5c50e54cb..73f497eca 100644 --- a/Test/450.frag +++ b/Test/450.frag @@ -14,4 +14,7 @@ void main() v3 = dFdyFine(in3); float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1); v4 = fwidthCoarse(in4) + fwidthFine(in4); + + float cull = gl_CullDistance[2]; + float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances; } diff --git a/Test/450.geom b/Test/450.geom new file mode 100644 index 000000000..af6768137 --- /dev/null +++ b/Test/450.geom @@ -0,0 +1,14 @@ +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[]; + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +void main() +{ + gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} diff --git a/Test/450.tesc b/Test/450.tesc new file mode 100644 index 000000000..9cbf71c00 --- /dev/null +++ b/Test/450.tesc @@ -0,0 +1,14 @@ +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[gl_MaxPatchVertices]; + +out gl_PerVertex { + float gl_CullDistance[3]; +} gl_out[]; + +void main() +{ + gl_out[0].gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} diff --git a/Test/450.tese b/Test/450.tese new file mode 100644 index 000000000..61447931c --- /dev/null +++ b/Test/450.tese @@ -0,0 +1,14 @@ +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[gl_MaxPatchVertices]; + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +void main() +{ + gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} diff --git a/Test/450.vert b/Test/450.vert new file mode 100644 index 000000000..fb4c9c13c --- /dev/null +++ b/Test/450.vert @@ -0,0 +1,10 @@ +#version 450 core + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +void main() +{ + gl_CullDistance[2] = 4.5; +} diff --git a/Test/baseResults/450.comp.out b/Test/baseResults/450.comp.out new file mode 100644 index 000000000..67ec647ee --- /dev/null +++ b/Test/baseResults/450.comp.out @@ -0,0 +1,18 @@ +450.comp +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +local_size = (1, 1, 1) +0:? Sequence +0:? Linker Objects + + +Linked compute stage: + +ERROR: Linking compute stage: Missing entry point: Each stage requires one "void main()" entry point + +Shader version: 450 +local_size = (1, 1, 1) +0:? Sequence +0:? Linker Objects + diff --git a/Test/baseResults/450.frag.out b/Test/baseResults/450.frag.out index 02f2c33f0..a928c298d 100644 --- a/Test/baseResults/450.frag.out +++ b/Test/baseResults/450.frag.out @@ -47,11 +47,24 @@ Shader version: 450 0:16 'in4' (smooth in 4-component vector of float) 0:16 fwidthFine (4-component vector of float) 0:16 'in4' (smooth in 4-component vector of float) +0:18 Sequence +0:18 move second child to first child (float) +0:18 'cull' (float) +0:18 direct index (smooth float) +0:18 'gl_CullDistance' (smooth in implicitly-sized array of float) +0:18 Constant: +0:18 2 (const int) +0:19 Sequence +0:19 move second child to first child (float) +0:19 'consts' (float) +0:19 Constant: +0:19 16.000000 0:? Linker Objects 0:? 'in1' (smooth in float) 0:? 'in2' (smooth in 2-component vector of float) 0:? 'in3' (smooth in 3-component vector of float) 0:? 'in4' (smooth in 4-component vector of float) +0:? 'gl_CullDistance' (smooth in implicitly-sized array of float) Linked fragment stage: @@ -103,9 +116,22 @@ Shader version: 450 0:16 'in4' (smooth in 4-component vector of float) 0:16 fwidthFine (4-component vector of float) 0:16 'in4' (smooth in 4-component vector of float) +0:18 Sequence +0:18 move second child to first child (float) +0:18 'cull' (float) +0:18 direct index (smooth float) +0:18 'gl_CullDistance' (smooth in 3-element array of float) +0:18 Constant: +0:18 2 (const int) +0:19 Sequence +0:19 move second child to first child (float) +0:19 'consts' (float) +0:19 Constant: +0:19 16.000000 0:? Linker Objects 0:? 'in1' (smooth in float) 0:? 'in2' (smooth in 2-component vector of float) 0:? 'in3' (smooth in 3-component vector of float) 0:? 'in4' (smooth in 4-component vector of float) +0:? 'gl_CullDistance' (smooth in 3-element array of float) diff --git a/Test/baseResults/450.geom.out b/Test/baseResults/450.geom.out new file mode 100644 index 000000000..b367afc0a --- /dev/null +++ b/Test/baseResults/450.geom.out @@ -0,0 +1,72 @@ +450.geom +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +invocations = 0 +max_vertices = 0 +input primitive = none +output primitive = none +0:? Sequence +0:11 Function Definition: main( (void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (float) +0:13 direct index (layout(stream=0 ) float) +0:13 gl_CullDistance: direct index for structure (layout(stream=0 ) out implicitly-sized array of float) +0:13 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out implicitly-sized array of float gl_CullDistance}) +0:13 Constant: +0:13 3 (const uint) +0:13 Constant: +0:13 2 (const int) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float) +0:13 direct index (block{in implicitly-sized array of float gl_CullDistance}) +0:13 'gl_in' (in implicitly-sized array of block{in implicitly-sized array of float gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' (in implicitly-sized array of block{in implicitly-sized array of float gl_CullDistance}) +0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out implicitly-sized array of float gl_CullDistance}) + + +Linked geometry stage: + +ERROR: Linking geometry stage: At least one shader must specify an input layout primitive +ERROR: Linking geometry stage: At least one shader must specify an output layout primitive +ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value) + +Shader version: 450 +invocations = 0 +max_vertices = 0 +input primitive = none +output primitive = none +0:? Sequence +0:11 Function Definition: main( (void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (float) +0:13 direct index (layout(stream=0 ) float) +0:13 gl_CullDistance: direct index for structure (layout(stream=0 ) out 3-element array of float) +0:13 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-element array of float gl_CullDistance}) +0:13 Constant: +0:13 3 (const uint) +0:13 Constant: +0:13 2 (const int) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (in 1-element array of float) +0:13 direct index (block{in 1-element array of float gl_CullDistance}) +0:13 'gl_in' (in 2-element array of block{in 1-element array of float gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' (in 2-element array of block{in 1-element array of float gl_CullDistance}) +0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-element array of float gl_CullDistance}) + diff --git a/Test/baseResults/450.tesc.out b/Test/baseResults/450.tesc.out new file mode 100644 index 000000000..df54fa97e --- /dev/null +++ b/Test/baseResults/450.tesc.out @@ -0,0 +1,70 @@ +450.tesc +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +vertices = 0 +0:? Sequence +0:11 Function Definition: main( (void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (float) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (out implicitly-sized array of float) +0:13 direct index (block{out implicitly-sized array of float gl_CullDistance}) +0:13 'gl_out' (out implicitly-sized array of block{out implicitly-sized array of float gl_CullDistance}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float) +0:13 direct index (block{in implicitly-sized array of float gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance}) +0:? 'gl_out' (out implicitly-sized array of block{out implicitly-sized array of float gl_CullDistance}) + + +Linked tessellation control stage: + +ERROR: Linking tessellation control stage: At least one shader must specify an output layout(vertices=...) + +Shader version: 450 +vertices = 0 +0:? Sequence +0:11 Function Definition: main( (void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (float) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (out 1-element array of float) +0:13 direct index (block{out 1-element array of float gl_CullDistance}) +0:13 'gl_out' (out 1-element array of block{out 1-element array of float gl_CullDistance}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (in 1-element array of float) +0:13 direct index (block{in 1-element array of float gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance}) +0:? 'gl_out' (out 1-element array of block{out 1-element array of float gl_CullDistance}) + diff --git a/Test/baseResults/450.tese.out b/Test/baseResults/450.tese.out new file mode 100644 index 000000000..ef2e1c712 --- /dev/null +++ b/Test/baseResults/450.tese.out @@ -0,0 +1,68 @@ +450.tese +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +input primitive = none +vertex spacing = none +triangle order = none +0:? Sequence +0:11 Function Definition: main( (void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (float) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (out implicitly-sized array of float) +0:13 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance}) +0:13 Constant: +0:13 3 (const uint) +0:13 Constant: +0:13 2 (const int) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float) +0:13 direct index (block{in implicitly-sized array of float gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance}) +0:? 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance}) + + +Linked tessellation evaluation stage: + +ERROR: Linking tessellation evaluation stage: At least one shader must specify an input layout primitive + +Shader version: 450 +input primitive = none +vertex spacing = equal_spacing +triangle order = ccw +0:? Sequence +0:11 Function Definition: main( (void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (float) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (out 3-element array of float) +0:13 'anon@0' (out block{out 3-element array of float gl_CullDistance}) +0:13 Constant: +0:13 3 (const uint) +0:13 Constant: +0:13 2 (const int) +0:13 direct index (float) +0:13 gl_CullDistance: direct index for structure (in 1-element array of float) +0:13 direct index (block{in 1-element array of float gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance}) +0:? 'anon@0' (out block{out 3-element array of float gl_CullDistance}) + diff --git a/Test/baseResults/450.vert.out b/Test/baseResults/450.vert.out new file mode 100644 index 000000000..6b752d1b3 --- /dev/null +++ b/Test/baseResults/450.vert.out @@ -0,0 +1,47 @@ +450.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( (void) +0:7 Function Parameters: +0:9 Sequence +0:9 move second child to first child (float) +0:9 direct index (float) +0:9 gl_CullDistance: direct index for structure (out implicitly-sized array of float) +0:9 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance}) +0:9 Constant: +0:9 10 (const uint) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 4.500000 +0:? Linker Objects +0:? 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance}) +0:? 'gl_VertexID' (gl_VertexId int) +0:? 'gl_InstanceID' (gl_InstanceId int) + + +Linked vertex stage: + + +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( (void) +0:7 Function Parameters: +0:9 Sequence +0:9 move second child to first child (float) +0:9 direct index (float) +0:9 gl_CullDistance: direct index for structure (out 3-element array of float) +0:9 'anon@0' (out block{out 3-element array of float gl_CullDistance}) +0:9 Constant: +0:9 10 (const uint) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 4.500000 +0:? Linker Objects +0:? 'anon@0' (out block{out 3-element array of float gl_CullDistance}) +0:? 'gl_VertexID' (gl_VertexId int) +0:? 'gl_InstanceID' (gl_InstanceId int) + diff --git a/Test/baseResults/test.conf b/Test/baseResults/test.conf index bcdeed02c..a150a7e8e 100644 --- a/Test/baseResults/test.conf +++ b/Test/baseResults/test.conf @@ -78,6 +78,8 @@ MaxCombinedAtomicCounterBuffers 1 MaxAtomicCounterBufferSize 16384 MaxTransformFeedbackBuffers 4 MaxTransformFeedbackInterleavedComponents 64 +MaxCullDistances 8 +MaxCombinedClipAndCullDistances 8 nonInductiveForLoops 1 whileLoops 1 doWhileLoops 1 diff --git a/Test/testlist b/Test/testlist index 5d4b52bc4..b19db1366 100644 --- a/Test/testlist +++ b/Test/testlist @@ -71,7 +71,12 @@ numeral.frag 430.comp 440.vert 440.frag +450.vert +450.geom +450.tesc +450.tese 450.frag +450.comp dce.frag atomic_uint.frag ../../LunarGLASS/test/aggOps.frag diff --git a/glslang/Include/ResourceLimits.h b/glslang/Include/ResourceLimits.h index bdf879c5e..07feb7dac 100644 --- a/glslang/Include/ResourceLimits.h +++ b/glslang/Include/ResourceLimits.h @@ -130,6 +130,8 @@ struct TBuiltInResource { int maxAtomicCounterBufferSize; int maxTransformFeedbackBuffers; int maxTransformFeedbackInterleavedComponents; + int maxCullDistances; + int maxCombinedClipAndCullDistances; TLimits limits; }; diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 89116bcd1..778057681 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1221,7 +1221,7 @@ void TBuiltIns::initialize(int version, EProfile profile) "vec4 gl_Position;" // needs qualifier fixed later "float gl_PointSize;" // needs qualifier fixed later "float gl_ClipDistance[];" - ); + ); if (IncludeLegacy(version, profile)) stageBuiltins[EShLangVertex].append( "vec4 gl_ClipVertex;" // needs qualifier fixed later @@ -1232,6 +1232,10 @@ void TBuiltIns::initialize(int version, EProfile profile) "vec4 gl_TexCoord[];" "float gl_FogFragCoord;" ); + if (version >= 450) + stageBuiltins[EShLangVertex].append( + "float gl_CullDistance[];" + ); stageBuiltins[EShLangVertex].append( "};" "\n"); @@ -1285,6 +1289,10 @@ void TBuiltIns::initialize(int version, EProfile profile) "vec4 gl_TexCoord[];" "float gl_FogFragCoord;" ); + if (version >= 450) + stageBuiltins[EShLangGeometry].append( + "float gl_CullDistance[];" + ); stageBuiltins[EShLangGeometry].append( "} gl_in[];" @@ -1304,6 +1312,10 @@ void TBuiltIns::initialize(int version, EProfile profile) "vec4 gl_TexCoord[];" "float gl_FogFragCoord;" ); + if (version >= 450) + stageBuiltins[EShLangGeometry].append( + "float gl_CullDistance[];" + ); stageBuiltins[EShLangGeometry].append( "};" @@ -1356,6 +1368,10 @@ void TBuiltIns::initialize(int version, EProfile profile) "vec4 gl_TexCoord[];" "float gl_FogFragCoord;" ); + if (version >= 450) + stageBuiltins[EShLangTessControl].append( + "float gl_CullDistance[];" + ); stageBuiltins[EShLangTessControl].append( "} gl_out[];" @@ -1397,6 +1413,10 @@ void TBuiltIns::initialize(int version, EProfile profile) "vec4 gl_TexCoord[];" "float gl_FogFragCoord;" ); + if (version >= 450) + stageBuiltins[EShLangTessEvaluation].append( + "float gl_CullDistance[];" + ); stageBuiltins[EShLangTessEvaluation].append( "};" "\n"); @@ -1477,6 +1497,7 @@ void TBuiltIns::initialize(int version, EProfile profile) if (version >= 450) stageBuiltins[EShLangFragment].append( + "in float gl_CullDistance[];" "bool gl_HelperInvocation;" // needs qualifier fixed later ); } else { @@ -2200,6 +2221,10 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf "vec4 gl_TexCoord[];" "float gl_FogFragCoord;" ); + if (profile != EEsProfile && version >= 450) + s.append( + "float gl_CullDistance[];" + ); s.append( "} gl_in[gl_MaxPatchVertices];" "\n"); @@ -2301,6 +2326,14 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append(builtInConstant); } + // GL_ARB_cull_distance + if (profile != EEsProfile && version >= 450) { + snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances = %d;", resources.maxCullDistances); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedClipAndCullDistances = %d;", resources.maxCombinedClipAndCullDistances); + s.append(builtInConstant); + } + s.append("\n"); } diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 06dd27853..bdbe7752f 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -2559,6 +2559,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString& // // Either redeclare the requested block, or give an error message why it can't be done. // +// TODO: functionality: explicitly sizing members of redeclared blocks is not giving them an explicit size void TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& newTypeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes) { const char* feature = "built-in block redeclaration"; diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 2f700f287..5ebb89bd5 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -169,6 +169,7 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[GL_ARB_shader_image_load_store] = EBhDisable; extensionBehavior[GL_ARB_shader_atomic_counters] = EBhDisable; extensionBehavior[GL_ARB_derivative_control] = EBhDisable; +// extensionBehavior[GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members } // Get code that is not part of a shared symbol table, is specific to this shader, @@ -184,7 +185,8 @@ const char* TParseContext::getPreamble() "#define GL_OES_standard_derivatives 1\n" "#define GL_EXT_frag_depth 1\n" "#define GL_OES_EGL_image_external 1\n" - "#define GL_EXT_shader_texture_lod 1\n"; + "#define GL_EXT_shader_texture_lod 1\n" + ; } else { return "#define GL_ES 1\n" @@ -192,7 +194,8 @@ const char* TParseContext::getPreamble() "#define GL_OES_standard_derivatives 1\n" "#define GL_EXT_frag_depth 1\n" "#define GL_OES_EGL_image_external 1\n" - "#define GL_EXT_shader_texture_lod 1\n"; + "#define GL_EXT_shader_texture_lod 1\n" + ; } } else { return @@ -210,6 +213,7 @@ const char* TParseContext::getPreamble() "#define GL_ARB_shader_image_load_store 1\n" "#define GL_ARB_shader_atomic_counters 1\n" "#define GL_ARB_derivative_control 1\n" +// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members ; } } diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index 48ebbedd1..b97df31ba 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -93,6 +93,7 @@ const char* const GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_loca const char* const GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store"; const char* const GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters"; const char* const GL_ARB_derivative_control = "GL_ARB_derivative_control"; +//const char* const GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members } // end namespace glslang -- GitLab