Browse Source

Updated glslang.

Бранимир Караџић 6 years ago
parent
commit
b397feae3f

+ 1 - 0
3rdparty/glslang/BUILD.gn

@@ -152,6 +152,7 @@ source_set("glslang_sources") {
   if (is_win && !is_clang) {
     cflags = [
       "/wd4018", # signed/unsigned mismatch
+      "/wd4189", # local variable is initialized but not referenced
     ]
   }
 

+ 1 - 0
3rdparty/glslang/SPIRV/SpvPostProcess.cpp

@@ -258,6 +258,7 @@ void Builder::postProcess(Instruction& inst)
                 assert(inst.getNumOperands() >= 3);
                 unsigned int memoryAccess = inst.getImmediateOperand((inst.getOpCode() == OpStore) ? 2 : 1);
                 assert(memoryAccess & MemoryAccessAlignedMask);
+                static_cast<void>(memoryAccess);
                 // Compute the index of the alignment operand.
                 int alignmentIdx = 2;
                 if (inst.getOpCode() == OpStore)

+ 3 - 1
3rdparty/glslang/SPIRV/SpvTools.cpp

@@ -191,7 +191,9 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
         optimizer.RegisterPass(spvtools::CreateRedundantLineInfoElimPass());
     }
 
-    optimizer.Run(spirv.data(), spirv.size(), &spirv);
+    spvtools::OptimizerOptions spvOptOptions;
+    spvOptOptions.set_run_validator(false); // The validator may run as a seperate step later on
+    optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
 }
 
 }; // end namespace glslang

+ 123 - 2
3rdparty/glslang/SPIRV/spirv.hpp

@@ -50,11 +50,11 @@ namespace spv {
 typedef unsigned int Id;
 
 #define SPV_VERSION 0x10300
-#define SPV_REVISION 6
+#define SPV_REVISION 7
 
 static const unsigned int MagicNumber = 0x07230203;
 static const unsigned int Version = 0x00010300;
-static const unsigned int Revision = 6;
+static const unsigned int Revision = 7;
 static const unsigned int OpCodeMask = 0xffff;
 static const unsigned int WordCountShift = 16;
 
@@ -816,6 +816,9 @@ enum Capability {
     CapabilitySubgroupBufferBlockIOINTEL = 5569,
     CapabilitySubgroupImageBlockIOINTEL = 5570,
     CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
+    CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
+    CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
+    CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
     CapabilityMax = 0x7fffffff,
 };
 
@@ -1202,6 +1205,124 @@ enum Op {
     OpSubgroupImageMediaBlockWriteINTEL = 5581,
     OpDecorateStringGOOGLE = 5632,
     OpMemberDecorateStringGOOGLE = 5633,
+    OpVmeImageINTEL = 5699,
+    OpTypeVmeImageINTEL = 5700,
+    OpTypeAvcImePayloadINTEL = 5701,
+    OpTypeAvcRefPayloadINTEL = 5702,
+    OpTypeAvcSicPayloadINTEL = 5703,
+    OpTypeAvcMcePayloadINTEL = 5704,
+    OpTypeAvcMceResultINTEL = 5705,
+    OpTypeAvcImeResultINTEL = 5706,
+    OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707,
+    OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708,
+    OpTypeAvcImeSingleReferenceStreaminINTEL = 5709,
+    OpTypeAvcImeDualReferenceStreaminINTEL = 5710,
+    OpTypeAvcRefResultINTEL = 5711,
+    OpTypeAvcSicResultINTEL = 5712,
+    OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713,
+    OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714,
+    OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715,
+    OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716,
+    OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717,
+    OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718,
+    OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719,
+    OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720,
+    OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721,
+    OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722,
+    OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723,
+    OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724,
+    OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725,
+    OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726,
+    OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727,
+    OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728,
+    OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729,
+    OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730,
+    OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731,
+    OpSubgroupAvcMceConvertToImePayloadINTEL = 5732,
+    OpSubgroupAvcMceConvertToImeResultINTEL = 5733,
+    OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734,
+    OpSubgroupAvcMceConvertToRefResultINTEL = 5735,
+    OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736,
+    OpSubgroupAvcMceConvertToSicResultINTEL = 5737,
+    OpSubgroupAvcMceGetMotionVectorsINTEL = 5738,
+    OpSubgroupAvcMceGetInterDistortionsINTEL = 5739,
+    OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740,
+    OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741,
+    OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742,
+    OpSubgroupAvcMceGetInterDirectionsINTEL = 5743,
+    OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744,
+    OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745,
+    OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746,
+    OpSubgroupAvcImeInitializeINTEL = 5747,
+    OpSubgroupAvcImeSetSingleReferenceINTEL = 5748,
+    OpSubgroupAvcImeSetDualReferenceINTEL = 5749,
+    OpSubgroupAvcImeRefWindowSizeINTEL = 5750,
+    OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751,
+    OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752,
+    OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753,
+    OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754,
+    OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755,
+    OpSubgroupAvcImeSetWeightedSadINTEL = 5756,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757,
+    OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759,
+    OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761,
+    OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763,
+    OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764,
+    OpSubgroupAvcImeConvertToMceResultINTEL = 5765,
+    OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766,
+    OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767,
+    OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768,
+    OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769,
+    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770,
+    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771,
+    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772,
+    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773,
+    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774,
+    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775,
+    OpSubgroupAvcImeGetBorderReachedINTEL = 5776,
+    OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777,
+    OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778,
+    OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779,
+    OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780,
+    OpSubgroupAvcFmeInitializeINTEL = 5781,
+    OpSubgroupAvcBmeInitializeINTEL = 5782,
+    OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783,
+    OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784,
+    OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785,
+    OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786,
+    OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787,
+    OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788,
+    OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789,
+    OpSubgroupAvcRefConvertToMceResultINTEL = 5790,
+    OpSubgroupAvcSicInitializeINTEL = 5791,
+    OpSubgroupAvcSicConfigureSkcINTEL = 5792,
+    OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793,
+    OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794,
+    OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795,
+    OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796,
+    OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797,
+    OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798,
+    OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799,
+    OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800,
+    OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801,
+    OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802,
+    OpSubgroupAvcSicEvaluateIpeINTEL = 5803,
+    OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804,
+    OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805,
+    OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806,
+    OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807,
+    OpSubgroupAvcSicConvertToMceResultINTEL = 5808,
+    OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809,
+    OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810,
+    OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811,
+    OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812,
+    OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813,
+    OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
+    OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
+    OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
     OpMax = 0x7fffffff,
 };
 

+ 15 - 0
3rdparty/glslang/Test/310.tesc

@@ -128,6 +128,21 @@ void goodfoop()
     d = fma(d, d, d);
 }
 
+void bbextBad()
+{
+    gl_BoundingBoxEXT;  // ERROR without GL_EXT_primitive_bounding_box
+    gl_BoundingBox;  // ERROR, version < 320
+}
+
+#extension GL_EXT_primitive_bounding_box : enable
+
+void bbext()
+{
+    gl_BoundingBoxEXT[0] = vec4(0.0);
+    gl_BoundingBoxEXT[1] = vec4(1.0);
+    gl_BoundingBoxEXT[2] = vec4(2.0);  // ERROR, overflow
+}
+
 void bbBad()
 {
     gl_BoundingBoxOES;  // ERROR without GL_OES_primitive_bounding_box 

+ 14 - 3
3rdparty/glslang/Test/320.tesc

@@ -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

+ 144 - 103
3rdparty/glslang/Test/baseResults/310.tesc.out

@@ -37,19 +37,21 @@ GL_OES_gpu_shader5
 ERROR: 0:104: 'sample' : Reserved word. 
 ERROR: 0:106: 'vertices' : can only apply to a standalone qualifier 
 ERROR: 0:107: 'vertices' : inconsistent output number of vertices for array size of misSized
-ERROR: 0:133: 'gl_BoundingBoxOES' : required extension not requested: Possible extensions include:
-GL_EXT_primitive_bounding_box
-GL_OES_primitive_bounding_box
-ERROR: 0:142: '[' :  array index out of range '2'
-ERROR: 0:145: '' : array size required 
-ERROR: 0:161: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
-ERROR: 0:162: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
-ERROR: 0:165: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
-ERROR: 38 compilation errors.  No code generated.
+ERROR: 0:133: 'gl_BoundingBoxEXT' : required extension not requested: GL_EXT_primitive_bounding_box
+ERROR: 0:134: 'gl_BoundingBox' : undeclared identifier 
+ERROR: 0:143: '[' :  array index out of range '2'
+ERROR: 0:148: 'gl_BoundingBoxOES' : required extension not requested: GL_OES_primitive_bounding_box
+ERROR: 0:157: '[' :  array index out of range '2'
+ERROR: 0:160: '' : array size required 
+ERROR: 0:176: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 0:177: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 0:180: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 41 compilation errors.  No code generated.
 
 
 Shader version: 310
 Requested GL_ARB_separate_shader_objects
+Requested GL_EXT_primitive_bounding_box
 Requested GL_OES_gpu_shader5
 Requested GL_OES_primitive_bounding_box
 Requested GL_OES_shader_io_blocks
@@ -241,113 +243,151 @@ ERROR: node is still EOpNull!
 0:128          'd' ( noContraction temp highp float)
 0:128          'd' ( noContraction temp highp float)
 0:128          'd' ( noContraction temp highp float)
-0:131  Function Definition: bbBad( ( global void)
+0:131  Function Definition: bbextBad( ( global void)
 0:131    Function Parameters: 
 0:133    Sequence
-0:133      'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
-0:138  Function Definition: bb( ( global void)
-0:138    Function Parameters: 
-0:140    Sequence
-0:140      move second child to first child ( temp highp 4-component vector of float)
-0:140        direct index ( patch temp highp 4-component vector of float BoundingBox)
-0:140          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
-0:140          Constant:
-0:140            0 (const int)
-0:140        Constant:
-0:140          0.000000
-0:140          0.000000
-0:140          0.000000
-0:140          0.000000
+0:133      'gl_BoundingBoxEXT' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:134      'gl_BoundingBox' ( temp float)
+0:139  Function Definition: bbext( ( global void)
+0:139    Function Parameters: 
+0:141    Sequence
 0:141      move second child to first child ( temp highp 4-component vector of float)
 0:141        direct index ( patch temp highp 4-component vector of float BoundingBox)
-0:141          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:141          'gl_BoundingBoxEXT' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
 0:141          Constant:
-0:141            1 (const int)
+0:141            0 (const int)
 0:141        Constant:
-0:141          1.000000
-0:141          1.000000
-0:141          1.000000
-0:141          1.000000
+0:141          0.000000
+0:141          0.000000
+0:141          0.000000
+0:141          0.000000
 0:142      move second child to first child ( temp highp 4-component vector of float)
 0:142        direct index ( patch temp highp 4-component vector of float BoundingBox)
-0:142          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:142          'gl_BoundingBoxEXT' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
 0:142          Constant:
-0:142            2 (const int)
+0:142            1 (const int)
 0:142        Constant:
-0:142          2.000000
-0:142          2.000000
-0:142          2.000000
-0:142          2.000000
-0:153  Function Definition: outputtingOutparam(i1; ( global void)
+0:142          1.000000
+0:142          1.000000
+0:142          1.000000
+0:142          1.000000
+0:143      move second child to first child ( temp highp 4-component vector of float)
+0:143        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:143          'gl_BoundingBoxEXT' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:143          Constant:
+0:143            2 (const int)
+0:143        Constant:
+0:143          2.000000
+0:143          2.000000
+0:143          2.000000
+0:143          2.000000
+0:146  Function Definition: bbBad( ( global void)
+0:146    Function Parameters: 
+0:148    Sequence
+0:148      'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:153  Function Definition: bb( ( global void)
 0:153    Function Parameters: 
-0:153      'a' ( out highp int)
 0:155    Sequence
-0:155      move second child to first child ( temp highp int)
-0:155        'a' ( out highp int)
+0:155      move second child to first child ( temp highp 4-component vector of float)
+0:155        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:155          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:155          Constant:
+0:155            0 (const int)
 0:155        Constant:
-0:155          2 (const int)
-0:158  Function Definition: outputting( ( global void)
-0:158    Function Parameters: 
-0:160    Sequence
-0:160      move second child to first child ( temp highp int)
-0:160        indirect index ( temp highp int)
-0:160          'outa' ( out 4-element array of highp int)
-0:160          'gl_InvocationID' ( in highp int InvocationID)
-0:160        Constant:
-0:160          2 (const int)
-0:161      move second child to first child ( temp highp int)
-0:161        direct index ( temp highp int)
-0:161          'outa' ( out 4-element array of highp int)
-0:161          Constant:
-0:161            1 (const int)
-0:161        Constant:
-0:161          2 (const int)
-0:162      move second child to first child ( temp highp 4-component vector of float)
-0:162        gl_Position: direct index for structure ( out highp 4-component vector of float Position)
-0:162          direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:162            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:162            Constant:
-0:162              0 (const int)
-0:162          Constant:
-0:162            0 (const int)
-0:162        Constant:
-0:162          1.000000
-0:162          1.000000
-0:162          1.000000
-0:162          1.000000
-0:163      direct index ( temp highp int)
-0:163        'outa' ( out 4-element array of highp int)
-0:163        Constant:
-0:163          1 (const int)
-0:164      direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:164        'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:164        Constant:
-0:164          0 (const int)
-0:165      Function Call: outputtingOutparam(i1; ( global void)
-0:165        direct index ( temp highp int)
-0:165          'outa' ( out 4-element array of highp int)
-0:165          Constant:
-0:165            0 (const int)
-0:166      Function Call: outputtingOutparam(i1; ( global void)
-0:166        indirect index ( temp highp int)
-0:166          'outa' ( out 4-element array of highp int)
-0:166          'gl_InvocationID' ( in highp int InvocationID)
-0:167      move second child to first child ( temp highp float)
-0:167        f: direct index for structure ( out highp float)
-0:167          direct index ( patch temp block{ out highp float f})
-0:167            'patchIName' ( patch out 4-element array of block{ out highp float f})
-0:167            Constant:
-0:167              1 (const int)
-0:167          Constant:
-0:167            0 (const int)
-0:167        Constant:
-0:167          3.140000
-0:168      move second child to first child ( temp highp int)
-0:168        indirect index ( temp highp int)
-0:168          'outa' ( out 4-element array of highp int)
-0:168          'gl_InvocationID' ( in highp int InvocationID)
-0:168        Constant:
-0:168          2 (const int)
+0:155          0.000000
+0:155          0.000000
+0:155          0.000000
+0:155          0.000000
+0:156      move second child to first child ( temp highp 4-component vector of float)
+0:156        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:156          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:156          Constant:
+0:156            1 (const int)
+0:156        Constant:
+0:156          1.000000
+0:156          1.000000
+0:156          1.000000
+0:156          1.000000
+0:157      move second child to first child ( temp highp 4-component vector of float)
+0:157        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:157          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:157          Constant:
+0:157            2 (const int)
+0:157        Constant:
+0:157          2.000000
+0:157          2.000000
+0:157          2.000000
+0:157          2.000000
+0:168  Function Definition: outputtingOutparam(i1; ( global void)
+0:168    Function Parameters: 
+0:168      'a' ( out highp int)
+0:170    Sequence
+0:170      move second child to first child ( temp highp int)
+0:170        'a' ( out highp int)
+0:170        Constant:
+0:170          2 (const int)
+0:173  Function Definition: outputting( ( global void)
+0:173    Function Parameters: 
+0:175    Sequence
+0:175      move second child to first child ( temp highp int)
+0:175        indirect index ( temp highp int)
+0:175          'outa' ( out 4-element array of highp int)
+0:175          'gl_InvocationID' ( in highp int InvocationID)
+0:175        Constant:
+0:175          2 (const int)
+0:176      move second child to first child ( temp highp int)
+0:176        direct index ( temp highp int)
+0:176          'outa' ( out 4-element array of highp int)
+0:176          Constant:
+0:176            1 (const int)
+0:176        Constant:
+0:176          2 (const int)
+0:177      move second child to first child ( temp highp 4-component vector of float)
+0:177        gl_Position: direct index for structure ( out highp 4-component vector of float Position)
+0:177          direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:177            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:177            Constant:
+0:177              0 (const int)
+0:177          Constant:
+0:177            0 (const int)
+0:177        Constant:
+0:177          1.000000
+0:177          1.000000
+0:177          1.000000
+0:177          1.000000
+0:178      direct index ( temp highp int)
+0:178        'outa' ( out 4-element array of highp int)
+0:178        Constant:
+0:178          1 (const int)
+0:179      direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:179        'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:179        Constant:
+0:179          0 (const int)
+0:180      Function Call: outputtingOutparam(i1; ( global void)
+0:180        direct index ( temp highp int)
+0:180          'outa' ( out 4-element array of highp int)
+0:180          Constant:
+0:180            0 (const int)
+0:181      Function Call: outputtingOutparam(i1; ( global void)
+0:181        indirect index ( temp highp int)
+0:181          'outa' ( out 4-element array of highp int)
+0:181          'gl_InvocationID' ( in highp int InvocationID)
+0:182      move second child to first child ( temp highp float)
+0:182        f: direct index for structure ( out highp float)
+0:182          direct index ( patch temp block{ out highp float f})
+0:182            'patchIName' ( patch out 4-element array of block{ out highp float f})
+0:182            Constant:
+0:182              1 (const int)
+0:182          Constant:
+0:182            0 (const int)
+0:182        Constant:
+0:182          3.140000
+0:183      move second child to first child ( temp highp int)
+0:183        indirect index ( temp highp int)
+0:183          'outa' ( out 4-element array of highp int)
+0:183          'gl_InvocationID' ( in highp int InvocationID)
+0:183        Constant:
+0:183          2 (const int)
 0:?   Linker Objects
 0:?     'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
 0:?     'outa' ( out 4-element array of highp int)
@@ -381,6 +421,7 @@ Linked tessellation control stage:
 
 Shader version: 310
 Requested GL_ARB_separate_shader_objects
+Requested GL_EXT_primitive_bounding_box
 Requested GL_OES_gpu_shader5
 Requested GL_OES_primitive_bounding_box
 Requested GL_OES_shader_io_blocks

+ 137 - 88
3rdparty/glslang/Test/baseResults/320.tesc.out

@@ -37,16 +37,20 @@ GL_OES_tessellation_point_size
 ERROR: 0:105: 'gl_PointSize' : required extension not requested: Possible extensions include:
 GL_EXT_tessellation_point_size
 GL_OES_tessellation_point_size
-ERROR: 0:123: '[' :  array index out of range '2'
-ERROR: 0:126: '' : array size required 
-ERROR: 0:142: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
-ERROR: 0:143: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
-ERROR: 0:146: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
-ERROR: 35 compilation errors.  No code generated.
+ERROR: 0:121: 'gl_BoundingBoxEXT' : required extension not requested: GL_EXT_primitive_bounding_box
+ERROR: 0:122: 'gl_BoundingBoxOES' : required extension not requested: GL_OES_primitive_bounding_box
+ERROR: 0:125: '[' :  array index out of range '2'
+ERROR: 0:137: '' : array size required 
+ERROR: 0:153: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 0:154: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 0:157: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID 
+ERROR: 37 compilation errors.  No code generated.
 
 
 Shader version: 320
 Requested GL_ARB_separate_shader_objects
+Requested GL_EXT_primitive_bounding_box
+Requested GL_OES_primitive_bounding_box
 vertices = 4
 ERROR: node is still EOpNull!
 0:13  Function Definition: main( ( global void)
@@ -229,7 +233,7 @@ ERROR: node is still EOpNull!
 0:121    Sequence
 0:121      move second child to first child ( temp highp 4-component vector of float)
 0:121        direct index ( patch temp highp 4-component vector of float BoundingBox)
-0:121          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:121          'gl_BoundingBoxEXT' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
 0:121          Constant:
 0:121            0 (const int)
 0:121        Constant:
@@ -241,92 +245,135 @@ ERROR: node is still EOpNull!
 0:122        direct index ( patch temp highp 4-component vector of float BoundingBox)
 0:122          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
 0:122          Constant:
-0:122            1 (const int)
+0:122            0 (const int)
 0:122        Constant:
-0:122          1.000000
-0:122          1.000000
-0:122          1.000000
-0:122          1.000000
+0:122          0.000000
+0:122          0.000000
+0:122          0.000000
+0:122          0.000000
 0:123      move second child to first child ( temp highp 4-component vector of float)
 0:123        direct index ( patch temp highp 4-component vector of float BoundingBox)
-0:123          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:123          'gl_BoundingBox' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
 0:123          Constant:
-0:123            2 (const int)
+0:123            0 (const int)
 0:123        Constant:
-0:123          2.000000
-0:123          2.000000
-0:123          2.000000
-0:123          2.000000
-0:134  Function Definition: outputtingOutparam(i1; ( global void)
-0:134    Function Parameters: 
-0:134      'a' ( out highp int)
-0:136    Sequence
-0:136      move second child to first child ( temp highp int)
-0:136        'a' ( out highp int)
-0:136        Constant:
-0:136          2 (const int)
-0:139  Function Definition: outputting( ( global void)
-0:139    Function Parameters: 
-0:141    Sequence
-0:141      move second child to first child ( temp highp int)
-0:141        indirect index ( temp highp int)
-0:141          'outa' ( out 4-element array of highp int)
-0:141          'gl_InvocationID' ( in highp int InvocationID)
-0:141        Constant:
-0:141          2 (const int)
-0:142      move second child to first child ( temp highp int)
-0:142        direct index ( temp highp int)
-0:142          'outa' ( out 4-element array of highp int)
-0:142          Constant:
-0:142            1 (const int)
-0:142        Constant:
-0:142          2 (const int)
-0:143      move second child to first child ( temp highp 4-component vector of float)
-0:143        gl_Position: direct index for structure ( out highp 4-component vector of float Position)
-0:143          direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:143            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:143            Constant:
-0:143              0 (const int)
-0:143          Constant:
-0:143            0 (const int)
-0:143        Constant:
-0:143          1.000000
-0:143          1.000000
-0:143          1.000000
-0:143          1.000000
-0:144      direct index ( temp highp int)
-0:144        'outa' ( out 4-element array of highp int)
-0:144        Constant:
-0:144          1 (const int)
-0:145      direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:145        'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
-0:145        Constant:
-0:145          0 (const int)
-0:146      Function Call: outputtingOutparam(i1; ( global void)
-0:146        direct index ( temp highp int)
-0:146          'outa' ( out 4-element array of highp int)
-0:146          Constant:
-0:146            0 (const int)
-0:147      Function Call: outputtingOutparam(i1; ( global void)
-0:147        indirect index ( temp highp int)
-0:147          'outa' ( out 4-element array of highp int)
-0:147          'gl_InvocationID' ( in highp int InvocationID)
-0:148      move second child to first child ( temp highp float)
-0:148        f: direct index for structure ( out highp float)
-0:148          direct index ( patch temp block{ out highp float f})
-0:148            'patchIName' ( patch out 4-element array of block{ out highp float f})
-0:148            Constant:
-0:148              1 (const int)
-0:148          Constant:
-0:148            0 (const int)
-0:148        Constant:
-0:148          3.140000
-0:149      move second child to first child ( temp highp int)
-0:149        indirect index ( temp highp int)
-0:149          'outa' ( out 4-element array of highp int)
-0:149          'gl_InvocationID' ( in highp int InvocationID)
-0:149        Constant:
-0:149          2 (const int)
+0:123          1.000000
+0:123          1.000000
+0:123          1.000000
+0:123          1.000000
+0:124      move second child to first child ( temp highp 4-component vector of float)
+0:124        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:124          'gl_BoundingBox' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:124          Constant:
+0:124            1 (const int)
+0:124        Constant:
+0:124          1.000000
+0:124          1.000000
+0:124          1.000000
+0:124          1.000000
+0:125      move second child to first child ( temp highp 4-component vector of float)
+0:125        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:125          'gl_BoundingBox' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:125          Constant:
+0:125            2 (const int)
+0:125        Constant:
+0:125          2.000000
+0:125          2.000000
+0:125          2.000000
+0:125          2.000000
+0:131  Function Definition: bbext( ( global void)
+0:131    Function Parameters: 
+0:133    Sequence
+0:133      move second child to first child ( temp highp 4-component vector of float)
+0:133        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:133          'gl_BoundingBoxEXT' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:133          Constant:
+0:133            1 (const int)
+0:133        Constant:
+0:133          0.000000
+0:133          0.000000
+0:133          0.000000
+0:133          0.000000
+0:134      move second child to first child ( temp highp 4-component vector of float)
+0:134        direct index ( patch temp highp 4-component vector of float BoundingBox)
+0:134          'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox)
+0:134          Constant:
+0:134            1 (const int)
+0:134        Constant:
+0:134          0.000000
+0:134          0.000000
+0:134          0.000000
+0:134          0.000000
+0:145  Function Definition: outputtingOutparam(i1; ( global void)
+0:145    Function Parameters: 
+0:145      'a' ( out highp int)
+0:147    Sequence
+0:147      move second child to first child ( temp highp int)
+0:147        'a' ( out highp int)
+0:147        Constant:
+0:147          2 (const int)
+0:150  Function Definition: outputting( ( global void)
+0:150    Function Parameters: 
+0:152    Sequence
+0:152      move second child to first child ( temp highp int)
+0:152        indirect index ( temp highp int)
+0:152          'outa' ( out 4-element array of highp int)
+0:152          'gl_InvocationID' ( in highp int InvocationID)
+0:152        Constant:
+0:152          2 (const int)
+0:153      move second child to first child ( temp highp int)
+0:153        direct index ( temp highp int)
+0:153          'outa' ( out 4-element array of highp int)
+0:153          Constant:
+0:153            1 (const int)
+0:153        Constant:
+0:153          2 (const int)
+0:154      move second child to first child ( temp highp 4-component vector of float)
+0:154        gl_Position: direct index for structure ( out highp 4-component vector of float Position)
+0:154          direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:154            'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:154            Constant:
+0:154              0 (const int)
+0:154          Constant:
+0:154            0 (const int)
+0:154        Constant:
+0:154          1.000000
+0:154          1.000000
+0:154          1.000000
+0:154          1.000000
+0:155      direct index ( temp highp int)
+0:155        'outa' ( out 4-element array of highp int)
+0:155        Constant:
+0:155          1 (const int)
+0:156      direct index ( temp block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:156        'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
+0:156        Constant:
+0:156          0 (const int)
+0:157      Function Call: outputtingOutparam(i1; ( global void)
+0:157        direct index ( temp highp int)
+0:157          'outa' ( out 4-element array of highp int)
+0:157          Constant:
+0:157            0 (const int)
+0:158      Function Call: outputtingOutparam(i1; ( global void)
+0:158        indirect index ( temp highp int)
+0:158          'outa' ( out 4-element array of highp int)
+0:158          'gl_InvocationID' ( in highp int InvocationID)
+0:159      move second child to first child ( temp highp float)
+0:159        f: direct index for structure ( out highp float)
+0:159          direct index ( patch temp block{ out highp float f})
+0:159            'patchIName' ( patch out 4-element array of block{ out highp float f})
+0:159            Constant:
+0:159              1 (const int)
+0:159          Constant:
+0:159            0 (const int)
+0:159        Constant:
+0:159          3.140000
+0:160      move second child to first child ( temp highp int)
+0:160        indirect index ( temp highp int)
+0:160          'outa' ( out 4-element array of highp int)
+0:160          'gl_InvocationID' ( in highp int InvocationID)
+0:160        Constant:
+0:160          2 (const int)
 0:?   Linker Objects
 0:?     'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position,  out highp float PointSize gl_PointSize})
 0:?     'outa' ( out 4-element array of highp int)
@@ -360,6 +407,8 @@ Linked tessellation control stage:
 
 Shader version: 320
 Requested GL_ARB_separate_shader_objects
+Requested GL_EXT_primitive_bounding_box
+Requested GL_OES_primitive_bounding_box
 vertices = 4
 ERROR: node is still EOpNull!
 0:13  Function Definition: main( ( global void)

+ 31 - 41
3rdparty/glslang/Test/baseResults/spv.RayGenShader.rgen.out

@@ -1,7 +1,7 @@
 spv.RayGenShader.rgen
 // Module Version 10000
 // Generated by (magic number): 80007
-// Id's are bound by 61
+// Id's are bound by 54
 
                               Capability RayTracingNV
                               Extension  "SPV_NV_ray_tracing"
@@ -18,23 +18,22 @@ spv.RayGenShader.rgen
                               Name 21  "gl_LaunchSizeNV"
                               Name 24  "sy"
                               Name 29  "accNV0"
-                              Name 48  "block"
-                              MemberName 48(block) 0  "arr"
-                              MemberName 48(block) 1  "pad"
-                              Name 50  ""
-                              Name 56  "payload"
-                              Name 60  "accNV1"
+                              Name 37  "block"
+                              MemberName 37(block) 0  "dir"
+                              MemberName 37(block) 1  "origin"
+                              Name 39  ""
+                              Name 50  "accNV1"
+                              Name 53  "payload"
                               Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV
                               Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV
                               Decorate 29(accNV0) DescriptorSet 0
                               Decorate 29(accNV0) Binding 0
-                              Decorate 46 ArrayStride 4
-                              MemberDecorate 48(block) 0 Offset 0
-                              MemberDecorate 48(block) 1 Offset 16
-                              Decorate 48(block) BufferBlock
-                              Decorate 56(payload) Location 0
-                              Decorate 60(accNV1) DescriptorSet 0
-                              Decorate 60(accNV1) Binding 1
+                              MemberDecorate 37(block) 0 Offset 0
+                              MemberDecorate 37(block) 1 Offset 16
+                              Decorate 37(block) BufferBlock
+                              Decorate 50(accNV1) DescriptorSet 0
+                              Decorate 50(accNV1) Binding 1
+                              Decorate 53(payload) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -51,27 +50,19 @@ spv.RayGenShader.rgen
       29(accNV0):     28(ptr) Variable UniformConstant
               35:             TypeFloat 32
               36:             TypeVector 35(float) 3
-              37:   35(float) Constant 0
-              38:   36(fvec3) ConstantComposite 37 37 37
-              39:   35(float) Constant 1056964608
-              40:   35(float) Constant 1065353216
-              41:   36(fvec3) ConstantComposite 40 40 40
-              42:   35(float) Constant 1061158912
-              43:             TypeInt 32 1
-              44:     43(int) Constant 1
-              45:      6(int) Constant 4
-              46:             TypeArray 35(float) 45
-              47:             TypeVector 35(float) 4
-       48(block):             TypeStruct 46 47(fvec4)
-              49:             TypePointer ShaderRecordBufferNV 48(block)
-              50:     49(ptr) Variable ShaderRecordBufferNV
-              51:     43(int) Constant 0
-              52:     43(int) Constant 3
-              53:             TypePointer ShaderRecordBufferNV 35(float)
-              55:             TypePointer RayPayloadNV 47(fvec4)
-     56(payload):     55(ptr) Variable RayPayloadNV
-              58:             TypePointer ShaderRecordBufferNV 47(fvec4)
-      60(accNV1):     28(ptr) Variable UniformConstant
+       37(block):             TypeStruct 36(fvec3) 36(fvec3)
+              38:             TypePointer ShaderRecordBufferNV 37(block)
+              39:     38(ptr) Variable ShaderRecordBufferNV
+              40:             TypeInt 32 1
+              41:     40(int) Constant 1
+              42:             TypePointer ShaderRecordBufferNV 36(fvec3)
+              45:   35(float) Constant 1056964608
+              46:     40(int) Constant 0
+              49:   35(float) Constant 1061158912
+      50(accNV1):     28(ptr) Variable UniformConstant
+              51:             TypeVector 35(float) 4
+              52:             TypePointer RayPayloadNV 51(fvec4)
+     53(payload):     52(ptr) Variable RayPayloadNV
          4(main):           2 Function None 3
                5:             Label
            8(lx):      7(ptr) Variable Function
@@ -95,11 +86,10 @@ spv.RayGenShader.rgen
               32:      6(int) Load 16(ly)
               33:      6(int) Load 20(sx)
               34:      6(int) Load 24(sy)
-                              TraceNV 30 31 32 33 34 12 38 39 41 42 44
-              54:     53(ptr) AccessChain 50 51 52
-                              Store 54 40
-              57:   47(fvec4) Load 56(payload)
-              59:     58(ptr) AccessChain 50 44
-                              Store 59 57
+              43:     42(ptr) AccessChain 39 41
+              44:   36(fvec3) Load 43
+              47:     42(ptr) AccessChain 39 46
+              48:   36(fvec3) Load 47
+                              TraceNV 30 31 32 33 34 12 44 45 48 49 41
                               Return
                               FunctionEnd

+ 27 - 37
3rdparty/glslang/Test/baseResults/spv.RayGenShader11.rgen.out

@@ -1,7 +1,7 @@
 spv.RayGenShader11.rgen
 // Module Version 10300
 // Generated by (magic number): 80007
-// Id's are bound by 60
+// Id's are bound by 53
 
                               Capability RayTracingNV
                               Extension  "SPV_NV_ray_tracing"
@@ -18,20 +18,19 @@ spv.RayGenShader11.rgen
                               Name 21  "gl_LaunchSizeNV"
                               Name 24  "sy"
                               Name 29  "accNV"
-                              Name 48  "block"
-                              MemberName 48(block) 0  "arr"
-                              MemberName 48(block) 1  "pad"
-                              Name 50  ""
-                              Name 56  "payload"
+                              Name 37  "block"
+                              MemberName 37(block) 0  "dir"
+                              MemberName 37(block) 1  "origin"
+                              Name 39  ""
+                              Name 52  "payload"
                               Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV
                               Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV
                               Decorate 29(accNV) DescriptorSet 0
                               Decorate 29(accNV) Binding 0
-                              Decorate 46 ArrayStride 4
-                              MemberDecorate 48(block) 0 Offset 0
-                              MemberDecorate 48(block) 1 Offset 16
-                              Decorate 48(block) Block
-                              Decorate 56(payload) Location 0
+                              MemberDecorate 37(block) 0 Offset 0
+                              MemberDecorate 37(block) 1 Offset 16
+                              Decorate 37(block) Block
+                              Decorate 52(payload) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -48,26 +47,18 @@ spv.RayGenShader11.rgen
        29(accNV):     28(ptr) Variable UniformConstant
               35:             TypeFloat 32
               36:             TypeVector 35(float) 3
-              37:   35(float) Constant 0
-              38:   36(fvec3) ConstantComposite 37 37 37
-              39:   35(float) Constant 1056964608
-              40:   35(float) Constant 1065353216
-              41:   36(fvec3) ConstantComposite 40 40 40
-              42:   35(float) Constant 1061158912
-              43:             TypeInt 32 1
-              44:     43(int) Constant 1
-              45:      6(int) Constant 4
-              46:             TypeArray 35(float) 45
-              47:             TypeVector 35(float) 4
-       48(block):             TypeStruct 46 47(fvec4)
-              49:             TypePointer ShaderRecordBufferNV 48(block)
-              50:     49(ptr) Variable ShaderRecordBufferNV
-              51:     43(int) Constant 0
-              52:     43(int) Constant 3
-              53:             TypePointer ShaderRecordBufferNV 35(float)
-              55:             TypePointer RayPayloadNV 47(fvec4)
-     56(payload):     55(ptr) Variable RayPayloadNV
-              58:             TypePointer ShaderRecordBufferNV 47(fvec4)
+       37(block):             TypeStruct 36(fvec3) 36(fvec3)
+              38:             TypePointer ShaderRecordBufferNV 37(block)
+              39:     38(ptr) Variable ShaderRecordBufferNV
+              40:             TypeInt 32 1
+              41:     40(int) Constant 1
+              42:             TypePointer ShaderRecordBufferNV 36(fvec3)
+              45:   35(float) Constant 1056964608
+              46:     40(int) Constant 0
+              49:   35(float) Constant 1061158912
+              50:             TypeVector 35(float) 4
+              51:             TypePointer RayPayloadNV 50(fvec4)
+     52(payload):     51(ptr) Variable RayPayloadNV
          4(main):           2 Function None 3
                5:             Label
            8(lx):      7(ptr) Variable Function
@@ -91,11 +82,10 @@ spv.RayGenShader11.rgen
               32:      6(int) Load 16(ly)
               33:      6(int) Load 20(sx)
               34:      6(int) Load 24(sy)
-                              TraceNV 30 31 32 33 34 12 38 39 41 42 44
-              54:     53(ptr) AccessChain 50 51 52
-                              Store 54 40
-              57:   47(fvec4) Load 56(payload)
-              59:     58(ptr) AccessChain 50 44
-                              Store 59 57
+              43:     42(ptr) AccessChain 39 41
+              44:   36(fvec3) Load 43
+              47:     42(ptr) AccessChain 39 46
+              48:   36(fvec3) Load 47
+                              TraceNV 30 31 32 33 34 12 44 45 48 49 41
                               Return
                               FunctionEnd

+ 2 - 1
3rdparty/glslang/Test/baseResults/spv.RayGenShader_Errors.rgen.out

@@ -31,7 +31,8 @@ ERROR: 0:36: 'gl_HitKindNV' : undeclared identifier
 ERROR: 0:37: 'reportIntersectionNV' : no matching overloaded function found 
 ERROR: 0:38: 'ignoreIntersectionNV' : no matching overloaded function found 
 ERROR: 0:39: 'terminateRayNV' : no matching overloaded function found 
-ERROR: 32 compilation errors.  No code generated.
+ERROR: 0:40: 'assign' :  l-value required "anon@3" (can't modify a shaderrecordnv qualified buffer)
+ERROR: 33 compilation errors.  No code generated.
 
 
 ERROR: Linking ray-generation stage: Only one shaderRecordNV buffer block is allowed per stage

+ 4 - 5
3rdparty/glslang/Test/spv.RayGenShader.rgen

@@ -5,8 +5,9 @@ layout(binding = 1, set = 0) uniform accelerationStructureNV accNV1; // Unused
 layout(location = 0) rayPayloadNV vec4 payload;
 layout(shaderRecordNV) buffer block
 {
-	float arr[4];
-	vec4 pad;
+	vec3 dir;
+	vec3 origin;
+
 };
 void main()
 {
@@ -14,7 +15,5 @@ void main()
     uint ly = gl_LaunchIDNV.y;
     uint sx = gl_LaunchSizeNV.x;
     uint sy = gl_LaunchSizeNV.y;
-    traceNV(accNV0, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1);
-    arr[3] = 1.0f;
-    pad = payload;
+    traceNV(accNV0, lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1);
 }

+ 3 - 5
3rdparty/glslang/Test/spv.RayGenShader11.rgen

@@ -4,8 +4,8 @@ layout(binding = 0, set = 0) uniform accelerationStructureNV accNV;
 layout(location = 0) rayPayloadNV vec4 payload;
 layout(shaderRecordNV) buffer block
 {
-	float arr[4];
-	vec4 pad;
+	vec3 dir;
+	vec3 origin;
 };
 void main()
 {
@@ -13,7 +13,5 @@ void main()
     uint ly = gl_LaunchIDNV.y;
     uint sx = gl_LaunchSizeNV.x;
     uint sy = gl_LaunchSizeNV.y;
-    traceNV(accNV, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1);
-    arr[3] = 1.0f;
-    pad = payload;
+    traceNV(accNV, lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1);
 }

+ 1 - 0
3rdparty/glslang/Test/spv.RayGenShader_Errors.rgen

@@ -37,4 +37,5 @@ void main()
     reportIntersectionNV(1.0, 1U);                          // ERROR, unsupported builtin in stage
     ignoreIntersectionNV();                                 // ERROR, unsupported builtin in stage
     terminateRayNV();                                       // ERROR, unsupported builtin in stage
+    d = 1.0f;                                               // ERROR, can't modify shaderRecordNV block
 }

+ 1 - 1
3rdparty/glslang/glslang/Include/revision.h

@@ -1,3 +1,3 @@
 // This header is generated by the make-revision script.
 
-#define GLSLANG_PATCH_LEVEL 3113
+#define GLSLANG_PATCH_LEVEL 3170

+ 16 - 3
3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp

@@ -5794,7 +5794,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "patch out highp float gl_TessLevelOuter[4];"
             "patch out highp float gl_TessLevelInner[2];"
             "patch out highp vec4 gl_BoundingBoxOES[2];"
+            "patch out highp vec4 gl_BoundingBoxEXT[2];"
             "\n");
+        if (profile == EEsProfile && version >= 320) {
+            stageBuiltins[EShLangTessControl].append(
+                "patch out highp vec4 gl_BoundingBox[2];"
+                "\n"
+            );
+        }
     }
 
     if ((profile != EEsProfile && version >= 140) ||
@@ -8014,10 +8021,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 
     case EShLangTessControl:
         if (profile == EEsProfile && version >= 310) {
+            BuiltInVariable("gl_BoundingBoxEXT", EbvBoundingBox, symbolTable);
+            symbolTable.setVariableExtensions("gl_BoundingBoxEXT", 1,
+                                              &E_GL_EXT_primitive_bounding_box);
             BuiltInVariable("gl_BoundingBoxOES", EbvBoundingBox, symbolTable);
-            if (version < 320)
-                symbolTable.setVariableExtensions("gl_BoundingBoxOES", Num_AEP_primitive_bounding_box,
-                                                  AEP_primitive_bounding_box);
+            symbolTable.setVariableExtensions("gl_BoundingBoxOES", 1,
+                                              &E_GL_OES_primitive_bounding_box);
+
+            if (version >= 320) {
+                BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable);
+            }
         }
 
         // Fall through

+ 4 - 0
3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp

@@ -152,6 +152,10 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
     case EvqBuffer:
         if (node->getQualifier().readonly)
             message = "can't modify a readonly buffer";
+#ifdef NV_EXTENSIONS
+        if (node->getQualifier().layoutShaderRecordNV)
+            message = "can't modify a shaderrecordnv qualified buffer";
+#endif
         break;
 #ifdef NV_EXTENSIONS
     case EvqHitAttrNV:

+ 5 - 1
3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp

@@ -43,6 +43,7 @@
 #else
 #include <cmath>
 #endif
+#include <cstdint>
 
 namespace {
 
@@ -1162,8 +1163,11 @@ static void OutputDouble(TInfoSink& out, double value, TOutputTraverser::EExtraO
         switch (extra) {
         case TOutputTraverser::BinaryDoubleOutput:
         {
+            uint64_t b;
+            static_assert(sizeof(b) == sizeof(value), "sizeof(uint64_t) != sizeof(double)");
+            memcpy(&b, &value, sizeof(b));
+
             out.debug << " : ";
-            long long b = *reinterpret_cast<long long*>(&value);
             for (size_t i = 0; i < 8 * sizeof(value); ++i, ++b) {
                 out.debug << ((b & 0x8000000000000000) != 0 ? "1" : "0");
                 b <<= 1;