Implement GL_ARB_shader_texture_image_samples. Also add in gl_MaxSamples and the...
authorJohn Kessenich <cepheus@frii.com>
Wed, 13 Aug 2014 16:54:02 +0000 (16:54 +0000)
committerJohn Kessenich <cepheus@frii.com>
Wed, 13 Aug 2014 16:54:02 +0000 (16:54 +0000)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27721 e7fa87d3-cd2b-0410-9028-fcbf551c1848

StandAlone/StandAlone.cpp
Test/430.vert
Test/450.frag
Test/baseResults/430.vert.out
Test/baseResults/450.frag.out
Test/baseResults/test.conf
glslang/Include/ResourceLimits.h
glslang/MachineIndependent/Initialize.cpp
glslang/MachineIndependent/ParseHelper.cpp
glslang/MachineIndependent/Versions.cpp
glslang/MachineIndependent/Versions.h

index 9174b13..471bd10 100644 (file)
@@ -199,6 +199,7 @@ const char* DefaultConfig =
     "MaxTransformFeedbackInterleavedComponents 64\n"
     "MaxCullDistances 8\n"
     "MaxCombinedClipAndCullDistances 8\n"
+    "MaxSamples 4\n"
 
     "nonInductiveForLoops 1\n"
     "whileLoops 1\n"
@@ -407,6 +408,8 @@ void ProcessConfigFile()
             Resources.maxCullDistances = value;
         else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0)
             Resources.maxCombinedClipAndCullDistances = value;
+        else if (strcmp(token, "MaxSamples") == 0)
+            Resources.maxSamples = value;
 
         else if (strcmp(token, "nonInductiveForLoops") == 0)
             Resources.limits.nonInductiveForLoops = (value != 0);
index d1d31f4..0722823 100644 (file)
@@ -157,3 +157,26 @@ void fooBarrier()
 }\r
 \r
 buffer vec4 v;  // ERROR\r
+\r
+uniform sampler2DMS s2dms;\r
+uniform usampler2DMSArray us2dmsa;\r
+layout(rgba32i) uniform iimage2DMS ii2dms;\r
+layout(rgba32f) uniform image2DMSArray i2dmsa;\r
+\r
+void fooq()\r
+{\r
+    int s = textureSamples(s2dms); // ERROR\r
+    s += textureSamples(us2dmsa);  // ERROR\r
+    s += imageSamples(ii2dms);     // ERROR\r
+    s += imageSamples(i2dmsa);     // ERROR\r
+}\r
+\r
+#extension GL_ARB_shader_texture_image_samples : enable\r
+\r
+void fooq2()\r
+{\r
+    int s = textureSamples(s2dms);\r
+    s += textureSamples(us2dmsa); \r
+    s += imageSamples(ii2dms);    \r
+    s += imageSamples(i2dmsa);    \r
+}\r
index b321dc1..a2d99e8 100644 (file)
@@ -16,7 +16,7 @@ void main()
     v4 = fwidthCoarse(in4) + fwidthFine(in4);\r
 \r
     float cull = gl_CullDistance[2];\r
-    float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances;\r
+    float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples;\r
 \r
     if (gl_HelperInvocation)\r
         ++v4;\r
@@ -33,3 +33,17 @@ void main()
     uint um = mix(uin, uin, b);\r
     ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b));\r
 }\r
+\r
+uniform sampler2DMS s2dms;\r
+uniform usampler2DMSArray us2dmsa;\r
+layout(rgba32i) uniform iimage2DMS ii2dms;\r
+layout(rgba32f) uniform image2DMSArray i2dmsa;\r
+\r
+void foo()\r
+{\r
+    int s = textureSamples(s2dms);\r
+    s += textureSamples(us2dmsa);\r
+    s += imageSamples(ii2dms);\r
+    s += imageSamples(i2dmsa);\r
+    float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5);\r
+}\r
index b087e34..3f6515b 100644 (file)
@@ -49,11 +49,16 @@ ERROR: 0:150: 'barrier' : no matching overloaded function found
 ERROR: 0:154: 'memoryBarrierShared' : no matching overloaded function found \r
 ERROR: 0:156: 'groupMemoryBarrier' : no matching overloaded function found \r
 ERROR: 0:159: 'buffer' : buffers can be declared only as blocks \r
-ERROR: 49 compilation errors.  No code generated.\r
+ERROR: 0:168: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions \r
+ERROR: 0:169: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions \r
+ERROR: 0:170: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions \r
+ERROR: 0:171: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions \r
+ERROR: 53 compilation errors.  No code generated.\r
 \r
 \r
 Shader version: 430\r
 Requested GL_ARB_enhanced_layouts\r
+Requested GL_ARB_shader_texture_image_samples\r
 in xfb mode\r
 ERROR: node is still EOpNull!\r
 0:14  Function Definition: foo( (void)\r
@@ -88,6 +93,46 @@ ERROR: node is still EOpNull!
 0:155      MemoryBarrierImage (void)\r
 0:156      Constant:\r
 0:156        0.000000\r
+0:166  Function Definition: fooq( (void)\r
+0:166    Function Parameters: \r
+0:168    Sequence\r
+0:168      Sequence\r
+0:168        move second child to first child (int)\r
+0:168          's' (int)\r
+0:168          Function Call: textureSamples(s21; (int)\r
+0:168            's2dms' (uniform sampler2DMS)\r
+0:169      add second child into first child (int)\r
+0:169        's' (int)\r
+0:169        Function Call: textureSamples(usA21; (int)\r
+0:169          'us2dmsa' (uniform usampler2DMSArray)\r
+0:170      add second child into first child (int)\r
+0:170        's' (int)\r
+0:170        Function Call: imageSamples(iI21; (int)\r
+0:170          'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:171      add second child into first child (int)\r
+0:171        's' (int)\r
+0:171        Function Call: imageSamples(IA21; (int)\r
+0:171          'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
+0:176  Function Definition: fooq2( (void)\r
+0:176    Function Parameters: \r
+0:178    Sequence\r
+0:178      Sequence\r
+0:178        move second child to first child (int)\r
+0:178          's' (int)\r
+0:178          Function Call: textureSamples(s21; (int)\r
+0:178            's2dms' (uniform sampler2DMS)\r
+0:179      add second child into first child (int)\r
+0:179        's' (int)\r
+0:179        Function Call: textureSamples(usA21; (int)\r
+0:179          'us2dmsa' (uniform usampler2DMSArray)\r
+0:180      add second child into first child (int)\r
+0:180        's' (int)\r
+0:180        Function Call: imageSamples(iI21; (int)\r
+0:180          'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:181      add second child into first child (int)\r
+0:181        's' (int)\r
+0:181        Function Call: imageSamples(IA21; (int)\r
+0:181          'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
 0:?   Linker Objects\r
 0:?     'v4' (layout(location=3 ) 4-component vector of float)\r
 0:?     'uv4' (layout(location=4 ) uniform 4-component vector of float)\r
@@ -129,6 +174,10 @@ ERROR: node is still EOpNull!
 0:?     'bbinst5' (out block{layout(xfb_buffer=1 xfb_offset=0 ) out 4-component vector of float bbv1, layout(xfb_buffer=1 xfb_offset=64 xfb_stride=80 ) out 4-component vector of float bbv2})\r
 0:?     'sharedv' (shared 4-component vector of float)\r
 0:?     'v' (buffer 4-component vector of float)\r
+0:?     's2dms' (uniform sampler2DMS)\r
+0:?     'us2dmsa' (uniform usampler2DMSArray)\r
+0:?     'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:?     'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
 0:?     'gl_VertexID' (gl_VertexId int)\r
 0:?     'gl_InstanceID' (gl_InstanceId int)\r
 \r
@@ -141,6 +190,7 @@ ERROR:     xfb_buffer 3, xfb_stride 64, minimum stride needed: 80
 \r
 Shader version: 430\r
 Requested GL_ARB_enhanced_layouts\r
+Requested GL_ARB_shader_texture_image_samples\r
 in xfb mode\r
 ERROR: node is still EOpNull!\r
 0:14  Function Definition: foo( (void)\r
@@ -175,6 +225,46 @@ ERROR: node is still EOpNull!
 0:155      MemoryBarrierImage (void)\r
 0:156      Constant:\r
 0:156        0.000000\r
+0:166  Function Definition: fooq( (void)\r
+0:166    Function Parameters: \r
+0:168    Sequence\r
+0:168      Sequence\r
+0:168        move second child to first child (int)\r
+0:168          's' (int)\r
+0:168          Function Call: textureSamples(s21; (int)\r
+0:168            's2dms' (uniform sampler2DMS)\r
+0:169      add second child into first child (int)\r
+0:169        's' (int)\r
+0:169        Function Call: textureSamples(usA21; (int)\r
+0:169          'us2dmsa' (uniform usampler2DMSArray)\r
+0:170      add second child into first child (int)\r
+0:170        's' (int)\r
+0:170        Function Call: imageSamples(iI21; (int)\r
+0:170          'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:171      add second child into first child (int)\r
+0:171        's' (int)\r
+0:171        Function Call: imageSamples(IA21; (int)\r
+0:171          'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
+0:176  Function Definition: fooq2( (void)\r
+0:176    Function Parameters: \r
+0:178    Sequence\r
+0:178      Sequence\r
+0:178        move second child to first child (int)\r
+0:178          's' (int)\r
+0:178          Function Call: textureSamples(s21; (int)\r
+0:178            's2dms' (uniform sampler2DMS)\r
+0:179      add second child into first child (int)\r
+0:179        's' (int)\r
+0:179        Function Call: textureSamples(usA21; (int)\r
+0:179          'us2dmsa' (uniform usampler2DMSArray)\r
+0:180      add second child into first child (int)\r
+0:180        's' (int)\r
+0:180        Function Call: imageSamples(iI21; (int)\r
+0:180          'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:181      add second child into first child (int)\r
+0:181        's' (int)\r
+0:181        Function Call: imageSamples(IA21; (int)\r
+0:181          'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
 0:?   Linker Objects\r
 0:?     'v4' (layout(location=3 ) 4-component vector of float)\r
 0:?     'uv4' (layout(location=4 ) uniform 4-component vector of float)\r
@@ -216,6 +306,10 @@ ERROR: node is still EOpNull!
 0:?     'bbinst5' (out block{layout(xfb_buffer=1 xfb_offset=0 ) out 4-component vector of float bbv1, layout(xfb_buffer=1 xfb_offset=64 xfb_stride=80 ) out 4-component vector of float bbv2})\r
 0:?     'sharedv' (shared 4-component vector of float)\r
 0:?     'v' (buffer 4-component vector of float)\r
+0:?     's2dms' (uniform sampler2DMS)\r
+0:?     'us2dmsa' (uniform usampler2DMSArray)\r
+0:?     'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:?     'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
 0:?     'gl_VertexID' (gl_VertexId int)\r
 0:?     'gl_InstanceID' (gl_InstanceId int)\r
 \r
index 4f52569..2d552a4 100644 (file)
@@ -58,7 +58,7 @@ Shader version: 450
 0:19        move second child to first child (float)\r
 0:19          'consts' (float)\r
 0:19          Constant:\r
-0:19            16.000000\r
+0:19            20.000000\r
 0:21      Test condition and select (void)\r
 0:21        Condition\r
 0:21        'gl_HelperInvocation' (in bool)\r
@@ -99,12 +99,47 @@ Shader version: 450
 0:34                'uin' (uint)\r
 0:34            Construct bvec3 (3-component vector of bool)\r
 0:34              'b' (bool)\r
+0:42  Function Definition: foo( (void)\r
+0:42    Function Parameters: \r
+0:44    Sequence\r
+0:44      Sequence\r
+0:44        move second child to first child (int)\r
+0:44          's' (int)\r
+0:44          Function Call: textureSamples(s21; (int)\r
+0:44            's2dms' (uniform sampler2DMS)\r
+0:45      add second child into first child (int)\r
+0:45        's' (int)\r
+0:45        Function Call: textureSamples(usA21; (int)\r
+0:45          'us2dmsa' (uniform usampler2DMSArray)\r
+0:46      add second child into first child (int)\r
+0:46        's' (int)\r
+0:46        Function Call: imageSamples(iI21; (int)\r
+0:46          'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:47      add second child into first child (int)\r
+0:47        's' (int)\r
+0:47        Function Call: imageSamples(IA21; (int)\r
+0:47          'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
+0:48      Sequence\r
+0:48        move second child to first child (float)\r
+0:48          'f' (float)\r
+0:48          Function Call: imageAtomicExchange(IA21;vi3;i1;f1; (float)\r
+0:48            'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
+0:48            Convert float to int (3-component vector of int)\r
+0:48              'in3' (smooth in 3-component vector of float)\r
+0:48            Constant:\r
+0:48              2 (const int)\r
+0:48            Constant:\r
+0:48              4.500000\r
 0:?   Linker Objects\r
 0:?     'in1' (smooth in float)\r
 0:?     'in2' (smooth in 2-component vector of float)\r
 0:?     'in3' (smooth in 3-component vector of float)\r
 0:?     'in4' (smooth in 4-component vector of float)\r
 0:?     'gl_CullDistance' (smooth in implicitly-sized array of float)\r
+0:?     's2dms' (uniform sampler2DMS)\r
+0:?     'us2dmsa' (uniform usampler2DMSArray)\r
+0:?     'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:?     'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
 \r
 \r
 Linked fragment stage:\r
@@ -167,7 +202,7 @@ Shader version: 450
 0:19        move second child to first child (float)\r
 0:19          'consts' (float)\r
 0:19          Constant:\r
-0:19            16.000000\r
+0:19            20.000000\r
 0:21      Test condition and select (void)\r
 0:21        Condition\r
 0:21        'gl_HelperInvocation' (in bool)\r
@@ -208,10 +243,45 @@ Shader version: 450
 0:34                'uin' (uint)\r
 0:34            Construct bvec3 (3-component vector of bool)\r
 0:34              'b' (bool)\r
+0:42  Function Definition: foo( (void)\r
+0:42    Function Parameters: \r
+0:44    Sequence\r
+0:44      Sequence\r
+0:44        move second child to first child (int)\r
+0:44          's' (int)\r
+0:44          Function Call: textureSamples(s21; (int)\r
+0:44            's2dms' (uniform sampler2DMS)\r
+0:45      add second child into first child (int)\r
+0:45        's' (int)\r
+0:45        Function Call: textureSamples(usA21; (int)\r
+0:45          'us2dmsa' (uniform usampler2DMSArray)\r
+0:46      add second child into first child (int)\r
+0:46        's' (int)\r
+0:46        Function Call: imageSamples(iI21; (int)\r
+0:46          'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:47      add second child into first child (int)\r
+0:47        's' (int)\r
+0:47        Function Call: imageSamples(IA21; (int)\r
+0:47          'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
+0:48      Sequence\r
+0:48        move second child to first child (float)\r
+0:48          'f' (float)\r
+0:48          Function Call: imageAtomicExchange(IA21;vi3;i1;f1; (float)\r
+0:48            'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
+0:48            Convert float to int (3-component vector of int)\r
+0:48              'in3' (smooth in 3-component vector of float)\r
+0:48            Constant:\r
+0:48              2 (const int)\r
+0:48            Constant:\r
+0:48              4.500000\r
 0:?   Linker Objects\r
 0:?     'in1' (smooth in float)\r
 0:?     'in2' (smooth in 2-component vector of float)\r
 0:?     'in3' (smooth in 3-component vector of float)\r
 0:?     'in4' (smooth in 4-component vector of float)\r
 0:?     'gl_CullDistance' (smooth in 3-element array of float)\r
+0:?     's2dms' (uniform sampler2DMS)\r
+0:?     'us2dmsa' (uniform usampler2DMSArray)\r
+0:?     'ii2dms' (layout(rgba32i ) uniform iimage2DMS)\r
+0:?     'i2dmsa' (layout(rgba32f ) uniform image2DMSArray)\r
 \r
index a150a7e..388d4a7 100644 (file)
@@ -80,6 +80,7 @@ MaxTransformFeedbackBuffers 4
 MaxTransformFeedbackInterleavedComponents 64\r
 MaxCullDistances 8\r
 MaxCombinedClipAndCullDistances 8\r
+MaxSamples 4\r
 nonInductiveForLoops 1\r
 whileLoops 1\r
 doWhileLoops 1\r
index 07feb7d..e8c743d 100644 (file)
@@ -132,6 +132,7 @@ struct TBuiltInResource {
     int maxTransformFeedbackInterleavedComponents;
     int maxCullDistances;
     int maxCombinedClipAndCullDistances;
+    int maxSamples;
 
     TLimits limits;
 };
index 8f363d9..1a354de 100644 (file)
@@ -1697,6 +1697,18 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi
         commonBuiltins.append(",int);\n");
     else
         commonBuiltins.append(");\n");
+
+    // GL_ARB_shader_texture_image_samples
+    // TODO: spec issue? there are no memory qualifiers; how to query a writeonly/readonly image, etc?
+    if (profile != EEsProfile && version >= 430 && sampler.ms) {
+        commonBuiltins.append("int ");
+        if (sampler.image)
+            commonBuiltins.append("imageSamples(");
+        else
+            commonBuiltins.append("textureSamples(");
+        commonBuiltins.append(typeName);
+        commonBuiltins.append(");\n");
+    }
 }
 
 //
@@ -1764,6 +1776,15 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi
             commonBuiltins.append(", ");
             commonBuiltins.append(dataType);
             commonBuiltins.append(");\n");
+        } else {
+            // not int or uint
+            // GL_ARB_ES3_1_compatibility
+            // TODO: spec issue: are there restrictions on the kind of layout() that can be used?  what about dropping memory qualifiers?
+            if (version >= 450) {
+                commonBuiltins.append("float imageAtomicExchange(coherent ");
+                commonBuiltins.append(imageParams);
+                commonBuiltins.append(", float);\n");
+            }
         }
     }
 }
@@ -2356,6 +2377,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
         s.append(builtInConstant);
         snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounterBuffers = %d;", resources.       maxGeometryAtomicCounterBuffers);
         s.append(builtInConstant);
+
+        s.append("\n");
     }
 
 
@@ -2380,16 +2403,24 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
         s.append(builtInConstant);
         snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounterBuffers = %d;", resources.maxComputeAtomicCounterBuffers);
         s.append(builtInConstant);
+
+        s.append("\n");
     }
 
     // GL_ARB_cull_distance
     if (profile != EEsProfile && version >= 450) {
-        snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances                = %d;", resources.maxCullDistances);
+        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);
     }
 
+    // GL_ARB_ES3_1_compatibility
+    if (profile != EEsProfile && version >= 450) {
+        snprintf(builtInConstant, maxSize, "const int gl_MaxSamples = %d;", resources.maxSamples);
+        s.append(builtInConstant);
+    }
+
     s.append("\n");
 }
 
index eb8c523..ad99dba 100644 (file)
@@ -1296,12 +1296,17 @@ void TParseContext::nonOpBuiltInCheck(TSourceLoc loc, const TFunction& fnCandida
             }
         }
     }
+
+    // GL_ARB_shader_texture_image_samples
+    if (fnCandidate.getName().compare(0, 14, "textureSamples") == 0 || fnCandidate.getName().compare(0, 12, "imageSamples") == 0)
+        profileRequires(loc, ~EEsProfile, 450, GL_ARB_shader_texture_image_samples, "textureSamples and imageSamples");
+
     if (fnCandidate.getName().compare(0, 11, "imageAtomic") == 0) {
         const TType& imageType = callNode.getSequence()[0]->getAsTyped()->getType();
         if (imageType.getSampler().type == EbtInt || imageType.getSampler().type == EbtUint) {
             if (imageType.getQualifier().layoutFormat != ElfR32i && imageType.getQualifier().layoutFormat != ElfR32ui)
                 error(loc, "only supported on image with format r32i or r32ui", fnCandidate.getName().c_str(), "");
-        } else
+        } else if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") != 0) 
             error(loc, "only supported on integer images", fnCandidate.getName().c_str(), "");
     }
 }
index 5ebb89b..5add18c 100644 (file)
@@ -149,26 +149,27 @@ namespace glslang {
 //
 void TParseContext::initializeExtensionBehavior()
 {
-    extensionBehavior[GL_OES_texture_3D]               = EBhDisable;
-    extensionBehavior[GL_OES_standard_derivatives]     = EBhDisable;
-    extensionBehavior[GL_EXT_frag_depth]               = EBhDisable;
-    extensionBehavior[GL_OES_EGL_image_external]       = EBhDisable;
-    extensionBehavior[GL_EXT_shader_texture_lod]       = EBhDisable;
-
-    extensionBehavior[GL_ARB_texture_rectangle]        = EBhDisable;
-    extensionBehavior[GL_3DL_array_objects]            = EBhDisable;
-    extensionBehavior[GL_ARB_shading_language_420pack] = EBhDisable;
-    extensionBehavior[GL_ARB_texture_gather]           = EBhDisable;
-    extensionBehavior[GL_ARB_gpu_shader5]              = EBhDisablePartial;
-    extensionBehavior[GL_ARB_separate_shader_objects]  = EBhDisable;
-    extensionBehavior[GL_ARB_tessellation_shader]      = EBhDisable;
-    extensionBehavior[GL_ARB_enhanced_layouts]         = EBhDisable;
-    extensionBehavior[GL_ARB_texture_cube_map_array]   = EBhDisable;
-    extensionBehavior[GL_ARB_shader_texture_lod]       = EBhDisable;
-    extensionBehavior[GL_ARB_explicit_attrib_location] = EBhDisablePartial; // "index" for fragment outputs is missing
-    extensionBehavior[GL_ARB_shader_image_load_store]  = EBhDisable;
-    extensionBehavior[GL_ARB_shader_atomic_counters]   = EBhDisable;
-    extensionBehavior[GL_ARB_derivative_control]       = EBhDisable;
+    extensionBehavior[GL_OES_texture_3D]                   = EBhDisable;
+    extensionBehavior[GL_OES_standard_derivatives]         = EBhDisable;
+    extensionBehavior[GL_EXT_frag_depth]                   = EBhDisable;
+    extensionBehavior[GL_OES_EGL_image_external]           = EBhDisable;
+    extensionBehavior[GL_EXT_shader_texture_lod]           = EBhDisable;
+                                                          
+    extensionBehavior[GL_ARB_texture_rectangle]            = EBhDisable;
+    extensionBehavior[GL_3DL_array_objects]                = EBhDisable;
+    extensionBehavior[GL_ARB_shading_language_420pack]     = EBhDisable;
+    extensionBehavior[GL_ARB_texture_gather]               = EBhDisable;
+    extensionBehavior[GL_ARB_gpu_shader5]                  = EBhDisablePartial;
+    extensionBehavior[GL_ARB_separate_shader_objects]      = EBhDisable;
+    extensionBehavior[GL_ARB_tessellation_shader]          = EBhDisable;
+    extensionBehavior[GL_ARB_enhanced_layouts]             = EBhDisable;
+    extensionBehavior[GL_ARB_texture_cube_map_array]       = EBhDisable;
+    extensionBehavior[GL_ARB_shader_texture_lod]           = EBhDisable;
+    extensionBehavior[GL_ARB_explicit_attrib_location]     = EBhDisablePartial; // "index" for fragment outputs is missing
+    extensionBehavior[GL_ARB_shader_image_load_store]      = EBhDisable;
+    extensionBehavior[GL_ARB_shader_atomic_counters]       = EBhDisable;
+    extensionBehavior[GL_ARB_derivative_control]           = EBhDisable;
+    extensionBehavior[GL_ARB_shader_texture_image_samples] = EBhDisable;
 //    extensionBehavior[GL_ARB_cull_distance]            = EBhDisable;    // present for 4.5, but need extension control over block members
 }
 
@@ -213,6 +214,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_shader_texture_image_samples 1\n"
 //            "#define GL_ARB_cull_distance 1\n"    // present for 4.5, but need extension control over block members
             ;
     }
index b97df31..7739567 100644 (file)
@@ -73,26 +73,27 @@ typedef enum {
 // Symbolic names for extensions.  Strings may be directly used when calling the
 // functions, but better to have the compiler do spelling checks.
 //
-const char* const GL_OES_texture_3D               = "GL_OES_texture_3D";
-const char* const GL_OES_standard_derivatives     = "GL_OES_standard_derivatives";
-const char* const GL_EXT_frag_depth               = "GL_EXT_frag_depth";
-const char* const GL_OES_EGL_image_external       = "GL_OES_EGL_image_external";
-const char* const GL_EXT_shader_texture_lod       = "GL_EXT_shader_texture_lod";
+const char* const GL_OES_texture_3D                   = "GL_OES_texture_3D";
+const char* const GL_OES_standard_derivatives         = "GL_OES_standard_derivatives";
+const char* const GL_EXT_frag_depth                   = "GL_EXT_frag_depth";
+const char* const GL_OES_EGL_image_external           = "GL_OES_EGL_image_external";
+const char* const GL_EXT_shader_texture_lod           = "GL_EXT_shader_texture_lod";
 
-const char* const GL_ARB_texture_rectangle        = "GL_ARB_texture_rectangle";
-const char* const GL_3DL_array_objects            = "GL_3DL_array_objects";
-const char* const GL_ARB_shading_language_420pack = "GL_ARB_shading_language_420pack";
-const char* const GL_ARB_texture_gather           = "GL_ARB_texture_gather";
-const char* const GL_ARB_gpu_shader5              = "GL_ARB_gpu_shader5";
-const char* const GL_ARB_separate_shader_objects  = "GL_ARB_separate_shader_objects";
-const char* const GL_ARB_tessellation_shader      = "GL_ARB_tessellation_shader";
-const char* const GL_ARB_enhanced_layouts         = "GL_ARB_enhanced_layouts";
-const char* const GL_ARB_texture_cube_map_array   = "GL_ARB_texture_cube_map_array";
-const char* const GL_ARB_shader_texture_lod       = "GL_ARB_shader_texture_lod";
-const char* const GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location";
-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_texture_rectangle            = "GL_ARB_texture_rectangle";
+const char* const GL_3DL_array_objects                = "GL_3DL_array_objects";
+const char* const GL_ARB_shading_language_420pack     = "GL_ARB_shading_language_420pack";
+const char* const GL_ARB_texture_gather               = "GL_ARB_texture_gather";
+const char* const GL_ARB_gpu_shader5                  = "GL_ARB_gpu_shader5";
+const char* const GL_ARB_separate_shader_objects      = "GL_ARB_separate_shader_objects";
+const char* const GL_ARB_tessellation_shader          = "GL_ARB_tessellation_shader";
+const char* const GL_ARB_enhanced_layouts             = "GL_ARB_enhanced_layouts";
+const char* const GL_ARB_texture_cube_map_array       = "GL_ARB_texture_cube_map_array";
+const char* const GL_ARB_shader_texture_lod           = "GL_ARB_shader_texture_lod";
+const char* const GL_ARB_explicit_attrib_location     = "GL_ARB_explicit_attrib_location";
+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_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples";
 //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