Browse Source

Updated glslang.

Бранимир Караџић 6 years ago
parent
commit
d558315887
49 changed files with 838 additions and 29 deletions
  1. 3 0
      3rdparty/glslang/SPIRV/GLSL.ext.NV.h
  2. 23 2
      3rdparty/glslang/SPIRV/GlslangToSpv.cpp
  3. 2 1
      3rdparty/glslang/SPIRV/SpvTools.cpp
  4. 1 1
      3rdparty/glslang/SPIRV/SpvTools.h
  5. 5 0
      3rdparty/glslang/SPIRV/doc.cpp
  6. 1 2
      3rdparty/glslang/Test/baseResults/310.comp.out
  7. 21 1
      3rdparty/glslang/Test/baseResults/glsl.450.subgroup.frag.out
  8. 21 1
      3rdparty/glslang/Test/baseResults/glsl.450.subgroup.geom.out
  9. 21 1
      3rdparty/glslang/Test/baseResults/glsl.450.subgroup.tesc.out
  10. 21 1
      3rdparty/glslang/Test/baseResults/glsl.450.subgroup.tese.out
  11. 21 1
      3rdparty/glslang/Test/baseResults/glsl.450.subgroup.vert.out
  12. 21 1
      3rdparty/glslang/Test/baseResults/glsl.450.subgroupBasic.comp.out
  13. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.mesh.out
  14. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rahit.out
  15. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rcall.out
  16. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rchit.out
  17. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rgen.out
  18. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rint.out
  19. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rmiss.out
  20. 21 1
      3rdparty/glslang/Test/baseResults/glsl.460.subgroup.task.out
  21. 0 1
      3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out
  22. 1 0
      3rdparty/glslang/Test/baseResults/spv.shaderBallot.comp.out
  23. 50 0
      3rdparty/glslang/Test/baseResults/spv.smBuiltins.frag.out
  24. 62 0
      3rdparty/glslang/Test/baseResults/spv.smBuiltins.vert.out
  25. 3 3
      3rdparty/glslang/Test/baseResults/spv.specConstant.vert.out
  26. 20 0
      3rdparty/glslang/Test/glsl.450.subgroup.frag
  27. 20 0
      3rdparty/glslang/Test/glsl.450.subgroup.geom
  28. 20 0
      3rdparty/glslang/Test/glsl.450.subgroup.tesc
  29. 21 0
      3rdparty/glslang/Test/glsl.450.subgroup.tese
  30. 21 0
      3rdparty/glslang/Test/glsl.450.subgroup.vert
  31. 20 0
      3rdparty/glslang/Test/glsl.450.subgroupBasic.comp
  32. 21 0
      3rdparty/glslang/Test/glsl.460.subgroup.mesh
  33. 20 0
      3rdparty/glslang/Test/glsl.460.subgroup.rahit
  34. 20 0
      3rdparty/glslang/Test/glsl.460.subgroup.rcall
  35. 20 0
      3rdparty/glslang/Test/glsl.460.subgroup.rchit
  36. 20 0
      3rdparty/glslang/Test/glsl.460.subgroup.rgen
  37. 20 0
      3rdparty/glslang/Test/glsl.460.subgroup.rint
  38. 20 0
      3rdparty/glslang/Test/glsl.460.subgroup.rmiss
  39. 20 0
      3rdparty/glslang/Test/glsl.460.subgroup.task
  40. 7 0
      3rdparty/glslang/Test/spv.smBuiltins.frag
  41. 11 0
      3rdparty/glslang/Test/spv.smBuiltins.vert
  42. 11 0
      3rdparty/glslang/glslang/Include/BaseTypes.h
  43. 3 2
      3rdparty/glslang/glslang/Include/Types.h
  44. 69 0
      3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
  45. 3 2
      3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
  46. 2 0
      3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
  47. 1 0
      3rdparty/glslang/glslang/MachineIndependent/Versions.h
  48. 2 0
      3rdparty/glslang/gtests/Spv.FromFile.cpp
  49. 1 1
      3rdparty/glslang/known_good.json

+ 3 - 0
3rdparty/glslang/SPIRV/GLSL.ext.NV.h

@@ -75,4 +75,7 @@ const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate";
 //SPV_NV_cooperative_matrix
 const char* const E_SPV_NV_cooperative_matrix = "SPV_NV_cooperative_matrix";
 
+//SPV_NV_shader_sm_builtins
+const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins";
+
 #endif  // #ifndef GLSLextNV_H

+ 23 - 2
3rdparty/glslang/SPIRV/GlslangToSpv.cpp

@@ -946,6 +946,24 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
     case glslang::EbvMeshViewIndicesNV:
         return spv::BuiltInMeshViewIndicesNV;
 #endif
+
+    // sm builtins
+    case glslang::EbvWarpsPerSM:
+        builder.addExtension(spv::E_SPV_NV_shader_sm_builtins);
+        builder.addCapability(spv::CapabilityShaderSMBuiltinsNV);
+        return spv::BuiltInWarpsPerSMNV;
+    case glslang::EbvSMCount:
+        builder.addExtension(spv::E_SPV_NV_shader_sm_builtins);
+        builder.addCapability(spv::CapabilityShaderSMBuiltinsNV);
+        return spv::BuiltInSMCountNV;
+    case glslang::EbvWarpID:
+        builder.addExtension(spv::E_SPV_NV_shader_sm_builtins);
+        builder.addCapability(spv::CapabilityShaderSMBuiltinsNV);
+        return spv::BuiltInWarpIDNV;
+    case glslang::EbvSMID:
+        builder.addExtension(spv::E_SPV_NV_shader_sm_builtins);
+        builder.addCapability(spv::CapabilityShaderSMBuiltinsNV);
+        return spv::BuiltInSMIDNV;
     default:
         return spv::BuiltInMax;
     }
@@ -8090,11 +8108,14 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector<unsigned int>&
 #if ENABLE_OPT
     // If from HLSL, run spirv-opt to "legalize" the SPIR-V for Vulkan
     // eg. forward and remove memory writes of opaque types.
-    if ((intermediate.getSource() == EShSourceHlsl || options->optimizeSize) && !options->disableOptimizer)
+    bool prelegalization = intermediate.getSource() == EShSourceHlsl;
+    if ((intermediate.getSource() == EShSourceHlsl || options->optimizeSize) && !options->disableOptimizer) {
         SpirvToolsLegalize(intermediate, spirv, logger, options);
+        prelegalization = false;
+    }
 
     if (options->validate)
-        SpirvToolsValidate(intermediate, spirv, logger);
+        SpirvToolsValidate(intermediate, spirv, logger, prelegalization);
 
     if (options->disassemble)
         SpirvToolsDisassemble(std::cout, spirv);

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

@@ -103,7 +103,7 @@ void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& s
 
 // Apply the SPIRV-Tools validator to generated SPIR-V.
 void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
-                        spv::SpvBuildLogger* logger)
+                        spv::SpvBuildLogger* logger, bool prelegalization)
 {
     // validate
     spv_context context = spvContextCreate(MapToSpirvToolsEnv(intermediate.getSpv(), logger));
@@ -111,6 +111,7 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<
     spv_diagnostic diagnostic = nullptr;
     spv_validator_options options = spvValidatorOptionsCreate();
     spvValidatorOptionsSetRelaxBlockLayout(options, intermediate.usingHlslOffsets());
+    spvValidatorOptionsSetBeforeHlslLegalization(options, prelegalization);
     spvValidateWithOptions(context, options, &binary, &diagnostic);
 
     // report

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

@@ -66,7 +66,7 @@ void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& s
 
 // Apply the SPIRV-Tools validator to generated SPIR-V.
 void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
-                        spv::SpvBuildLogger*);
+                        spv::SpvBuildLogger*, bool prelegalization);
 
 // Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of
 // legalizing HLSL SPIR-V.

+ 5 - 0
3rdparty/glslang/SPIRV/doc.cpp

@@ -423,6 +423,10 @@ const char* BuiltInString(int builtIn)
     case BuiltInMeshViewCountNV:       return "MeshViewCountNV";
     case BuiltInMeshViewIndicesNV:     return "MeshViewIndicesNV";
 #endif
+    case BuiltInWarpsPerSMNV:           return "WarpsPerSMNV";
+    case BuiltInSMCountNV:              return "SMCountNV";
+    case BuiltInWarpIDNV:               return "WarpIDNV";
+    case BuiltInSMIDNV:                 return "SMIDNV";
 
     default: return "Bad";
     }
@@ -948,6 +952,7 @@ const char* CapabilityString(int info)
     case CapabilityVariablePointers:                    return "VariablePointers";
 
     case CapabilityCooperativeMatrixNV:     return "CooperativeMatrixNV";
+    case CapabilityShaderSMBuiltinsNV:      return "ShaderSMBuiltinsNV";
 
     case CapabilityFragmentShaderSampleInterlockEXT:        return "CapabilityFragmentShaderSampleInterlockEXT";
     case CapabilityFragmentShaderPixelInterlockEXT:         return "CapabilityFragmentShaderPixelInterlockEXT";

+ 1 - 2
3rdparty/glslang/Test/baseResults/310.comp.out

@@ -29,7 +29,6 @@ ERROR: 0:94: 'writeonly' : argument cannot drop memory qualifier when passed to
 ERROR: 0:97: '' : memory qualifiers cannot be used on this type 
 ERROR: 0:98: '' : memory qualifiers cannot be used on this type 
 ERROR: 0:109: 'format' : image formats must match 
-ERROR: 0:110: 'restrict' : argument cannot drop memory qualifier when passed to formal parameter 
 ERROR: 0:110: 'format' : image formats must match 
 ERROR: 0:111: 'format' : image formats must match 
 ERROR: 0:114: 'image load-store format' : not supported with this profile: es
@@ -87,7 +86,7 @@ WARNING: 0:238: '#define' : names containing consecutive underscores are reserve
 ERROR: 0:244: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group
 ERROR: 0:245: 'gl_ViewIndex' : undeclared identifier 
 ERROR: 0:255: 'gl_ViewIndex' : undeclared identifier 
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 85 compilation errors.  No code generated.
 
 
 Shader version: 310

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.450.subgroup.frag.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:232: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:233: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:234: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:235: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -97,6 +101,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:3  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -597,6 +602,20 @@ ERROR: node is still EOpNull!
 0:226      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:226        'ballot' ( temp 4-component vector of uint)
 0:226        'parti' ( temp 4-component vector of uint)
+0:230  Function Definition: sm_builtins_err( ( global void)
+0:230    Function Parameters: 
+0:232    Sequence
+0:232      'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
+0:233      'gl_SMCountNV' ( flat in uint SMCountNV)
+0:234      'gl_WarpIDNV' ( flat in uint WarpIDNV)
+0:235      'gl_SMIDNV' ( flat in uint SMIDNV)
+0:242  Function Definition: sm_builtins( ( global void)
+0:242    Function Parameters: 
+0:244    Sequence
+0:244      'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
+0:245      'gl_SMCountNV' ( flat in uint SMCountNV)
+0:246      'gl_WarpIDNV' ( flat in uint WarpIDNV)
+0:247      'gl_SMIDNV' ( flat in uint SMIDNV)
 0:?   Linker Objects
 0:?     'data' (layout( location=0) out 4-component vector of uint)
 
@@ -613,6 +632,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:105  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.450.subgroup.geom.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:238: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:239: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:240: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:241: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -97,6 +101,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 invocations = -1
 max_vertices = 1
@@ -606,6 +611,20 @@ ERROR: node is still EOpNull!
 0:232      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:232        'ballot' ( temp 4-component vector of uint)
 0:232        'parti' ( temp 4-component vector of uint)
+0:236  Function Definition: sm_builtins_err( ( global void)
+0:236    Function Parameters: 
+0:238    Sequence
+0:238      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:239      'gl_SMCountNV' ( in uint SMCountNV)
+0:240      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:241      'gl_SMIDNV' ( in uint SMIDNV)
+0:248  Function Definition: sm_builtins( ( global void)
+0:248    Function Parameters: 
+0:250    Sequence
+0:250      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:251      'gl_SMCountNV' ( in uint SMCountNV)
+0:252      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:253      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'anon@0' (layout( set=0 binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer runtime-sized array of 4-component vector of uint result})
 
@@ -622,6 +641,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 invocations = 1
 max_vertices = 1

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.450.subgroup.tesc.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:237: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:238: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:239: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:240: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -97,6 +101,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 vertices = 1
 ERROR: node is still EOpNull!
@@ -603,6 +608,20 @@ ERROR: node is still EOpNull!
 0:231      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:231        'ballot' ( temp 4-component vector of uint)
 0:231        'parti' ( temp 4-component vector of uint)
+0:235  Function Definition: sm_builtins_err( ( global void)
+0:235    Function Parameters: 
+0:237    Sequence
+0:237      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:238      'gl_SMCountNV' ( in uint SMCountNV)
+0:239      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:240      'gl_SMIDNV' ( in uint SMIDNV)
+0:247  Function Definition: sm_builtins( ( global void)
+0:247    Function Parameters: 
+0:249    Sequence
+0:249      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:250      'gl_SMCountNV' ( in uint SMCountNV)
+0:251      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:252      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'anon@0' (layout( set=0 binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer runtime-sized array of 4-component vector of uint result})
 
@@ -619,6 +638,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 vertices = 1
 ERROR: node is still EOpNull!

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.450.subgroup.tese.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:237: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:238: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:239: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:240: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -97,6 +101,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 input primitive = isolines
 vertex spacing = none
@@ -605,6 +610,20 @@ ERROR: node is still EOpNull!
 0:231      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:231        'ballot' ( temp 4-component vector of uint)
 0:231        'parti' ( temp 4-component vector of uint)
+0:235  Function Definition: sm_builtins_err( ( global void)
+0:235    Function Parameters: 
+0:237    Sequence
+0:237      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:238      'gl_SMCountNV' ( in uint SMCountNV)
+0:239      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:240      'gl_SMIDNV' ( in uint SMIDNV)
+0:247  Function Definition: sm_builtins( ( global void)
+0:247    Function Parameters: 
+0:249    Sequence
+0:249      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:250      'gl_SMCountNV' ( in uint SMCountNV)
+0:251      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:252      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'anon@0' (layout( set=0 binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer runtime-sized array of 4-component vector of uint result})
 
@@ -621,6 +640,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 input primitive = isolines
 vertex spacing = equal_spacing

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.450.subgroup.vert.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:236: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:237: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:238: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:239: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -97,6 +101,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:3  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -602,6 +607,20 @@ ERROR: node is still EOpNull!
 0:230      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:230        'ballot' ( temp 4-component vector of uint)
 0:230        'parti' ( temp 4-component vector of uint)
+0:234  Function Definition: sm_builtins_err( ( global void)
+0:234    Function Parameters: 
+0:236    Sequence
+0:236      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:237      'gl_SMCountNV' ( in uint SMCountNV)
+0:238      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:239      'gl_SMIDNV' ( in uint SMIDNV)
+0:246  Function Definition: sm_builtins( ( global void)
+0:246    Function Parameters: 
+0:248    Sequence
+0:248      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:249      'gl_SMCountNV' ( in uint SMCountNV)
+0:250      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:251      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'anon@0' (layout( set=0 binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer runtime-sized array of 4-component vector of uint result})
 0:?     'gl_VertexID' ( gl_VertexId int VertexId)
@@ -620,6 +639,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:109  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.450.subgroupBasic.comp.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:242: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:243: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:244: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:245: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -97,6 +101,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 local_size = (8, 8, 1)
 ERROR: node is still EOpNull!
@@ -631,6 +636,20 @@ ERROR: node is still EOpNull!
 0:236      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:236        'ballot' ( temp 4-component vector of uint)
 0:236        'parti' ( temp 4-component vector of uint)
+0:240  Function Definition: sm_builtins_err( ( global void)
+0:240    Function Parameters: 
+0:242    Sequence
+0:242      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:243      'gl_SMCountNV' ( in uint SMCountNV)
+0:244      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:245      'gl_SMIDNV' ( in uint SMIDNV)
+0:252  Function Definition: sm_builtins( ( global void)
+0:252    Function Parameters: 
+0:254    Sequence
+0:254      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:255      'gl_SMCountNV' ( in uint SMCountNV)
+0:256      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:257      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize)
 0:?       8 (const uint)
@@ -651,6 +670,7 @@ Requested GL_KHR_shader_subgroup_quad
 Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 local_size = (8, 8, 1)
 ERROR: node is still EOpNull!

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.mesh.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:298: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:299: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:300: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:301: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_mesh_shader
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 max_vertices = 81
 max_primitives = 32
@@ -887,6 +892,20 @@ ERROR: node is still EOpNull!
 0:292      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:292        'ballot' ( temp 4-component vector of uint)
 0:292        'parti' ( temp 4-component vector of uint)
+0:296  Function Definition: sm_builtins_err( ( global void)
+0:296    Function Parameters: 
+0:298    Sequence
+0:298      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:299      'gl_SMCountNV' ( in uint SMCountNV)
+0:300      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:301      'gl_SMIDNV' ( in uint SMIDNV)
+0:308  Function Definition: sm_builtins( ( global void)
+0:308    Function Parameters: 
+0:310    Sequence
+0:310      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:311      'gl_SMCountNV' ( in uint SMCountNV)
+0:312      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:313      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize)
 0:?       32 (const uint)
@@ -910,6 +929,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_mesh_shader
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 max_vertices = 81
 max_primitives = 32

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rahit.out

@@ -85,7 +85,11 @@ ERROR: 0:96: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:97: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:99: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:259: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:260: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:261: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:262: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:4  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -671,6 +676,20 @@ ERROR: node is still EOpNull!
 0:253      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:253        'ballot' ( temp 4-component vector of uint)
 0:253        'parti' ( temp 4-component vector of uint)
+0:257  Function Definition: sm_builtins_err( ( global void)
+0:257    Function Parameters: 
+0:259    Sequence
+0:259      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:260      'gl_SMCountNV' ( in uint SMCountNV)
+0:261      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:262      'gl_SMIDNV' ( in uint SMIDNV)
+0:269  Function Definition: sm_builtins( ( global void)
+0:269    Function Parameters: 
+0:271    Sequence
+0:271      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:272      'gl_SMCountNV' ( in uint SMCountNV)
+0:273      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:274      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'incomingPayload' (layout( location=1) rayPayloadInNV 4-component vector of float)
 
@@ -688,6 +707,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:106  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rcall.out

@@ -85,7 +85,11 @@ ERROR: 0:96: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:97: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:99: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:247: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:248: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:249: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:250: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:4  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -614,6 +619,20 @@ ERROR: node is still EOpNull!
 0:241      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:241        'ballot' ( temp 4-component vector of uint)
 0:241        'parti' ( temp 4-component vector of uint)
+0:245  Function Definition: sm_builtins_err( ( global void)
+0:245    Function Parameters: 
+0:247    Sequence
+0:247      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:248      'gl_SMCountNV' ( in uint SMCountNV)
+0:249      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:250      'gl_SMIDNV' ( in uint SMIDNV)
+0:257  Function Definition: sm_builtins( ( global void)
+0:257    Function Parameters: 
+0:259    Sequence
+0:259      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:260      'gl_SMCountNV' ( in uint SMCountNV)
+0:261      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:262      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'data0' (layout( location=0) callableDataNV 4-component vector of float)
 0:?     'anon@0' (layout( location=1) callableDataInNV block{ callableDataInNV uint data1})
@@ -632,6 +651,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:109  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rchit.out

@@ -85,7 +85,11 @@ ERROR: 0:96: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:97: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:99: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:257: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:258: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:259: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:260: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:4  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -680,6 +685,20 @@ ERROR: node is still EOpNull!
 0:251      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:251        'ballot' ( temp 4-component vector of uint)
 0:251        'parti' ( temp 4-component vector of uint)
+0:255  Function Definition: sm_builtins_err( ( global void)
+0:255    Function Parameters: 
+0:257    Sequence
+0:257      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:258      'gl_SMCountNV' ( in uint SMCountNV)
+0:259      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:260      'gl_SMIDNV' ( in uint SMIDNV)
+0:267  Function Definition: sm_builtins( ( global void)
+0:267    Function Parameters: 
+0:269    Sequence
+0:269      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:270      'gl_SMCountNV' ( in uint SMCountNV)
+0:271      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:272      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'accNV' (layout( set=0 binding=0) uniform accelerationStructureNV)
 0:?     'localPayload' (layout( location=0) rayPayloadNV 4-component vector of float)
@@ -699,6 +718,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:108  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rgen.out

@@ -85,7 +85,11 @@ ERROR: 0:96: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:97: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:99: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:251: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:252: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:253: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:254: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:4  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -644,6 +649,20 @@ ERROR: node is still EOpNull!
 0:245      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:245        'ballot' ( temp 4-component vector of uint)
 0:245        'parti' ( temp 4-component vector of uint)
+0:249  Function Definition: sm_builtins_err( ( global void)
+0:249    Function Parameters: 
+0:251    Sequence
+0:251      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:252      'gl_SMCountNV' ( in uint SMCountNV)
+0:253      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:254      'gl_SMIDNV' ( in uint SMIDNV)
+0:261  Function Definition: sm_builtins( ( global void)
+0:261    Function Parameters: 
+0:263    Sequence
+0:263      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:264      'gl_SMCountNV' ( in uint SMCountNV)
+0:265      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:266      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'accNV0' (layout( set=0 binding=0) uniform accelerationStructureNV)
 0:?     'accNV1' (layout( set=0 binding=1) uniform accelerationStructureNV)
@@ -664,6 +683,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:113  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rint.out

@@ -85,7 +85,11 @@ ERROR: 0:97: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:98: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:99: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:100: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:257: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:258: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:259: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:260: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:5  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -658,6 +663,20 @@ ERROR: node is still EOpNull!
 0:251      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:251        'ballot' ( temp 4-component vector of uint)
 0:251        'parti' ( temp 4-component vector of uint)
+0:255  Function Definition: sm_builtins_err( ( global void)
+0:255    Function Parameters: 
+0:257    Sequence
+0:257      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:258      'gl_SMCountNV' ( in uint SMCountNV)
+0:259      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:260      'gl_SMIDNV' ( in uint SMIDNV)
+0:267  Function Definition: sm_builtins( ( global void)
+0:267    Function Parameters: 
+0:269    Sequence
+0:269      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:270      'gl_SMCountNV' ( in uint SMCountNV)
+0:271      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:272      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'iAttr' ( hitAttributeNV 4-component vector of float)
 
@@ -675,6 +694,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:108  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.rmiss.out

@@ -85,7 +85,11 @@ ERROR: 0:97: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:98: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:99: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:100: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:251: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:252: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:253: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:254: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:5  Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
@@ -652,6 +657,20 @@ ERROR: node is still EOpNull!
 0:245      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:245        'ballot' ( temp 4-component vector of uint)
 0:245        'parti' ( temp 4-component vector of uint)
+0:249  Function Definition: sm_builtins_err( ( global void)
+0:249    Function Parameters: 
+0:251    Sequence
+0:251      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:252      'gl_SMCountNV' ( in uint SMCountNV)
+0:253      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:254      'gl_SMIDNV' ( in uint SMIDNV)
+0:261  Function Definition: sm_builtins( ( global void)
+0:261    Function Parameters: 
+0:263    Sequence
+0:263      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:264      'gl_SMCountNV' ( in uint SMCountNV)
+0:265      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:266      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'accNV' (layout( set=0 binding=0) uniform accelerationStructureNV)
 0:?     'localPayload' (layout( location=0) rayPayloadNV 4-component vector of float)
@@ -671,6 +690,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_ray_tracing
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 ERROR: node is still EOpNull!
 0:109  Function Definition: main( ( global void)

+ 21 - 1
3rdparty/glslang/Test/baseResults/glsl.460.subgroup.task.out

@@ -85,7 +85,11 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
 ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
 ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 86 compilation errors.  No code generated.
+ERROR: 0:288: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:289: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:290: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:291: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 90 compilation errors.  No code generated.
 
 
 Shader version: 460
@@ -98,6 +102,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_mesh_shader
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 local_size = (32, 1, 1)
 ERROR: node is still EOpNull!
@@ -729,6 +734,20 @@ ERROR: node is still EOpNull!
 0:282      subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
 0:282        'ballot' ( temp 4-component vector of uint)
 0:282        'parti' ( temp 4-component vector of uint)
+0:286  Function Definition: sm_builtins_err( ( global void)
+0:286    Function Parameters: 
+0:288    Sequence
+0:288      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:289      'gl_SMCountNV' ( in uint SMCountNV)
+0:290      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:291      'gl_SMIDNV' ( in uint SMIDNV)
+0:298  Function Definition: sm_builtins( ( global void)
+0:298    Function Parameters: 
+0:300    Sequence
+0:300      'gl_WarpsPerSMNV' ( in uint WarpsPerSMNV)
+0:301      'gl_SMCountNV' ( in uint SMCountNV)
+0:302      'gl_WarpIDNV' ( in uint WarpIDNV)
+0:303      'gl_SMIDNV' ( in uint SMIDNV)
 0:?   Linker Objects
 0:?     'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize)
 0:?       32 (const uint)
@@ -753,6 +772,7 @@ Requested GL_KHR_shader_subgroup_shuffle
 Requested GL_KHR_shader_subgroup_shuffle_relative
 Requested GL_KHR_shader_subgroup_vote
 Requested GL_NV_mesh_shader
+Requested GL_NV_shader_sm_builtins
 Requested GL_NV_shader_subgroup_partitioned
 local_size = (32, 1, 1)
 ERROR: node is still EOpNull!

+ 0 - 1
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out

@@ -135,7 +135,6 @@ local_size = (256, 1, 1)
 0:?     'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer)
 0:?     'dispatchId' ( in 3-component vector of uint GlobalInvocationID)
 
-Validation failed
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 63

+ 1 - 0
3rdparty/glslang/Test/baseResults/spv.shaderBallot.comp.out

@@ -1,4 +1,5 @@
 spv.shaderBallot.comp
+Validation failed
 // Module Version 10000
 // Generated by (magic number): 80007
 // Id's are bound by 298

+ 50 - 0
3rdparty/glslang/Test/baseResults/spv.smBuiltins.frag.out

@@ -0,0 +1,50 @@
+spv.smBuiltins.frag
+// Module Version 10000
+// Generated by (magic number): 80007
+// Id's are bound by 20
+
+                              Capability Shader
+                              Capability ShaderSMBuiltinsNV
+                              Extension  "SPV_NV_shader_sm_builtins"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 9 11 13 15 17
+                              ExecutionMode 4 OriginUpperLeft
+                              Source GLSL 450
+                              SourceExtension  "GL_NV_shader_sm_builtins"
+                              Name 4  "main"
+                              Name 9  "data"
+                              Name 11  "gl_WarpsPerSMNV"
+                              Name 13  "gl_SMCountNV"
+                              Name 15  "gl_WarpIDNV"
+                              Name 17  "gl_SMIDNV"
+                              Decorate 9(data) Location 0
+                              Decorate 11(gl_WarpsPerSMNV) Flat
+                              Decorate 11(gl_WarpsPerSMNV) BuiltIn WarpsPerSMNV
+                              Decorate 13(gl_SMCountNV) Flat
+                              Decorate 13(gl_SMCountNV) BuiltIn SMCountNV
+                              Decorate 15(gl_WarpIDNV) Flat
+                              Decorate 15(gl_WarpIDNV) BuiltIn WarpIDNV
+                              Decorate 17(gl_SMIDNV) Flat
+                              Decorate 17(gl_SMIDNV) BuiltIn SMIDNV
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 4
+               8:             TypePointer Output 7(ivec4)
+         9(data):      8(ptr) Variable Output
+              10:             TypePointer Input 6(int)
+11(gl_WarpsPerSMNV):     10(ptr) Variable Input
+13(gl_SMCountNV):     10(ptr) Variable Input
+ 15(gl_WarpIDNV):     10(ptr) Variable Input
+   17(gl_SMIDNV):     10(ptr) Variable Input
+         4(main):           2 Function None 3
+               5:             Label
+              12:      6(int) Load 11(gl_WarpsPerSMNV)
+              14:      6(int) Load 13(gl_SMCountNV)
+              16:      6(int) Load 15(gl_WarpIDNV)
+              18:      6(int) Load 17(gl_SMIDNV)
+              19:    7(ivec4) CompositeConstruct 12 14 16 18
+                              Store 9(data) 19
+                              Return
+                              FunctionEnd

+ 62 - 0
3rdparty/glslang/Test/baseResults/spv.smBuiltins.vert.out

@@ -0,0 +1,62 @@
+spv.smBuiltins.vert
+// Module Version 10000
+// Generated by (magic number): 80007
+// Id's are bound by 29
+
+                              Capability Shader
+                              Capability ShaderSMBuiltinsNV
+                              Extension  "SPV_NV_shader_sm_builtins"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 15 18 20 22 24
+                              Source GLSL 450
+                              SourceExtension  "GL_NV_shader_sm_builtins"
+                              Name 4  "main"
+                              Name 9  "Output"
+                              MemberName 9(Output) 0  "result"
+                              Name 11  ""
+                              Name 15  "gl_VertexIndex"
+                              Name 18  "gl_WarpsPerSMNV"
+                              Name 20  "gl_SMCountNV"
+                              Name 22  "gl_WarpIDNV"
+                              Name 24  "gl_SMIDNV"
+                              Decorate 8 ArrayStride 16
+                              MemberDecorate 9(Output) 0 Offset 0
+                              Decorate 9(Output) BufferBlock
+                              Decorate 11 DescriptorSet 0
+                              Decorate 11 Binding 0
+                              Decorate 15(gl_VertexIndex) BuiltIn VertexIndex
+                              Decorate 18(gl_WarpsPerSMNV) BuiltIn WarpsPerSMNV
+                              Decorate 20(gl_SMCountNV) BuiltIn SMCountNV
+                              Decorate 22(gl_WarpIDNV) BuiltIn WarpIDNV
+                              Decorate 24(gl_SMIDNV) BuiltIn SMIDNV
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 4
+               8:             TypeRuntimeArray 7(ivec4)
+       9(Output):             TypeStruct 8
+              10:             TypePointer Uniform 9(Output)
+              11:     10(ptr) Variable Uniform
+              12:             TypeInt 32 1
+              13:     12(int) Constant 0
+              14:             TypePointer Input 12(int)
+15(gl_VertexIndex):     14(ptr) Variable Input
+              17:             TypePointer Input 6(int)
+18(gl_WarpsPerSMNV):     17(ptr) Variable Input
+20(gl_SMCountNV):     17(ptr) Variable Input
+ 22(gl_WarpIDNV):     17(ptr) Variable Input
+   24(gl_SMIDNV):     17(ptr) Variable Input
+              27:             TypePointer Uniform 7(ivec4)
+         4(main):           2 Function None 3
+               5:             Label
+              16:     12(int) Load 15(gl_VertexIndex)
+              19:      6(int) Load 18(gl_WarpsPerSMNV)
+              21:      6(int) Load 20(gl_SMCountNV)
+              23:      6(int) Load 22(gl_WarpIDNV)
+              25:      6(int) Load 24(gl_SMIDNV)
+              26:    7(ivec4) CompositeConstruct 19 21 23 25
+              28:     27(ptr) AccessChain 11 13 16
+                              Store 28 26
+                              Return
+                              FunctionEnd

+ 3 - 3
3rdparty/glslang/Test/baseResults/spv.specConstant.vert.out

@@ -11,7 +11,7 @@ spv.specConstant.vert
                               Source GLSL 400
                               Name 4  "main"
                               Name 9  "arraySize"
-                              Name 14  "foo(vf4[s2765];"
+                              Name 14  "foo(vf4[s2769];"
                               Name 13  "p"
                               Name 17  "builtin_spec_constant("
                               Name 20  "color"
@@ -102,10 +102,10 @@ spv.specConstant.vert
                               Store 20(color) 46
               48:          10 Load 22(ucol)
                               Store 47(param) 48
-              49:           2 FunctionCall 14(foo(vf4[s2765];) 47(param)
+              49:           2 FunctionCall 14(foo(vf4[s2769];) 47(param)
                               Return
                               FunctionEnd
-14(foo(vf4[s2765];):           2 Function None 12
+14(foo(vf4[s2769];):           2 Function None 12
            13(p):     11(ptr) FunctionParameter
               15:             Label
               54:     24(ptr) AccessChain 53(dupUcol) 23

+ 20 - 0
3rdparty/glslang/Test/glsl.450.subgroup.frag

@@ -226,3 +226,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.450.subgroup.geom

@@ -232,3 +232,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.450.subgroup.tesc

@@ -231,3 +231,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 21 - 0
3rdparty/glslang/Test/glsl.450.subgroup.tese

@@ -230,3 +230,24 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveOrNV(ballot, parti);
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
+
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 21 - 0
3rdparty/glslang/Test/glsl.450.subgroup.vert

@@ -230,3 +230,24 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}
+

+ 20 - 0
3rdparty/glslang/Test/glsl.450.subgroupBasic.comp

@@ -236,3 +236,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 21 - 0
3rdparty/glslang/Test/glsl.460.subgroup.mesh

@@ -291,3 +291,24 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveOrNV(ballot, parti);
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
+
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.460.subgroup.rahit

@@ -253,3 +253,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.460.subgroup.rcall

@@ -241,3 +241,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.460.subgroup.rchit

@@ -251,3 +251,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.460.subgroup.rgen

@@ -245,3 +245,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.460.subgroup.rint

@@ -251,3 +251,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.460.subgroup.rmiss

@@ -245,3 +245,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 20 - 0
3rdparty/glslang/Test/glsl.460.subgroup.task

@@ -282,3 +282,23 @@ void partitioned_works(vec4 f4)
   subgroupPartitionedExclusiveXorNV(ballot, parti);
 }
 
+// tests for NV_shader_sm_builtins
+void sm_builtins_err()
+{
+    gl_WarpsPerSMNV;    // ERROR, no extension
+    gl_SMCountNV;       // ERROR, no extension
+    gl_WarpIDNV;        // ERROR, no extension
+    gl_SMIDNV;          // ERROR, no extension
+}
+
+#ifdef GL_NV_shader_sm_builtins
+#extension GL_NV_shader_sm_builtins : enable
+#endif
+
+void sm_builtins()
+{
+    gl_WarpsPerSMNV;
+    gl_SMCountNV;
+    gl_WarpIDNV;
+    gl_SMIDNV;
+}

+ 7 - 0
3rdparty/glslang/Test/spv.smBuiltins.frag

@@ -0,0 +1,7 @@
+#version 450
+#extension GL_NV_shader_sm_builtins: enable
+layout(location = 0) out uvec4 data;
+void main (void)
+{
+  data = uvec4(gl_WarpsPerSMNV, gl_SMCountNV, gl_WarpIDNV, gl_SMIDNV);
+}

+ 11 - 0
3rdparty/glslang/Test/spv.smBuiltins.vert

@@ -0,0 +1,11 @@
+#version 450
+#extension GL_NV_shader_sm_builtins: enable
+layout(set = 0, binding = 0, std430) buffer Output
+{
+  uvec4 result[];
+};
+
+void main (void)
+{
+  result[gl_VertexIndex] = uvec4(gl_WarpsPerSMNV, gl_SMCountNV, gl_WarpIDNV, gl_SMIDNV);
+}

+ 11 - 0
3rdparty/glslang/glslang/Include/BaseTypes.h

@@ -275,6 +275,12 @@ enum TBuiltInVariable {
     EbvMeshViewIndicesNV,
 #endif
 
+    // sm builtins
+    EbvWarpsPerSM,
+    EbvSMCount,
+    EbvWarpID,
+    EbvSMID,
+
     // HLSL built-ins that live only temporarily, until they get remapped
     // to one of the above.
     EbvFragDepthGreater,
@@ -460,6 +466,11 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
     case EbvMeshViewIndicesNV:          return "MeshViewIndicesNV";
 #endif
 
+    case EbvWarpsPerSM:                 return "WarpsPerSMNV";
+    case EbvSMCount:                    return "SMCountNV";
+    case EbvWarpID:                     return "WarpIDNV";
+    case EbvSMID:                       return "SMIDNV";
+
     default:                      return "unknown built-in variable";
     }
 }

+ 3 - 2
3rdparty/glslang/glslang/Include/Types.h

@@ -514,8 +514,9 @@ public:
 
     const char*         semanticName;
     TStorageQualifier   storage   : 6;
-    TBuiltInVariable    builtIn   : 8;
-    TBuiltInVariable    declaredBuiltIn : 8;
+    TBuiltInVariable    builtIn   : 9;
+    TBuiltInVariable    declaredBuiltIn : 9;
+    static_assert(EbvLast < 256, "need to increase size of TBuiltInVariable bitfields!");
     TPrecisionQualifier precision : 3;
     bool invariant    : 1; // require canonical treatment for cross-shader invariance
     bool noContraction: 1; // prevent contraction and reassociation, e.g., for 'precise' keyword, and expressions it affects

+ 69 - 0
3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp

@@ -6141,6 +6141,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "in highp   uvec4 gl_SubgroupGtMask;"
             "in highp   uvec4 gl_SubgroupLeMask;"
             "in highp   uvec4 gl_SubgroupLtMask;"
+            // GL_NV_shader_sm_builtins
+            "in highp   uint  gl_WarpsPerSMNV;"
+            "in highp   uint  gl_SMCountNV;"
+            "in highp   uint  gl_WarpIDNV;"
+            "in highp   uint  gl_SMIDNV;"
             "\n";
         const char* fragmentSubgroupDecls =
             "flat in mediump uint  gl_SubgroupSize;"
@@ -6150,6 +6155,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "flat in highp   uvec4 gl_SubgroupGtMask;"
             "flat in highp   uvec4 gl_SubgroupLeMask;"
             "flat in highp   uvec4 gl_SubgroupLtMask;"
+            // GL_NV_shader_sm_builtins
+            "flat in highp   uint  gl_WarpsPerSMNV;"
+            "flat in highp   uint  gl_SMCountNV;"
+            "flat in highp   uint  gl_WarpIDNV;"
+            "flat in highp   uint  gl_SMIDNV;"
             "\n";
         const char* computeSubgroupDecls =
             "in highp   uint  gl_NumSubgroups;"
@@ -8181,6 +8191,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_SubgroupGtMask",       EbvSubgroupGtMask2,     symbolTable);
             BuiltInVariable("gl_SubgroupLeMask",       EbvSubgroupLeMask2,     symbolTable);
             BuiltInVariable("gl_SubgroupLtMask",       EbvSubgroupLtMask2,     symbolTable);
+
+            // GL_NV_shader_sm_builtins
+            symbolTable.setVariableExtensions("gl_WarpsPerSMNV",         1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMCountNV",            1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_WarpIDNV",             1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMIDNV",               1, &E_GL_NV_shader_sm_builtins);
+            BuiltInVariable("gl_WarpsPerSMNV",          EbvWarpsPerSM,      symbolTable);
+            BuiltInVariable("gl_SMCountNV",             EbvSMCount,         symbolTable);
+            BuiltInVariable("gl_WarpIDNV",              EbvWarpID,          symbolTable);
+            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
         }
 
         break;
@@ -8582,6 +8602,15 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveXorNV",            1, &E_GL_NV_shader_subgroup_partitioned);
 #endif
 
+            // GL_NV_shader_sm_builtins
+            symbolTable.setVariableExtensions("gl_WarpsPerSMNV",         1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMCountNV",            1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_WarpIDNV",             1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMIDNV",               1, &E_GL_NV_shader_sm_builtins);
+            BuiltInVariable("gl_WarpsPerSMNV",          EbvWarpsPerSM,      symbolTable);
+            BuiltInVariable("gl_SMCountNV",             EbvSMCount,         symbolTable);
+            BuiltInVariable("gl_WarpIDNV",              EbvWarpID,          symbolTable);
+            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
         }
 
         if (profile == EEsProfile) {
@@ -8686,6 +8715,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_SubgroupGtMask",       EbvSubgroupGtMask2,     symbolTable);
             BuiltInVariable("gl_SubgroupLeMask",       EbvSubgroupLeMask2,     symbolTable);
             BuiltInVariable("gl_SubgroupLtMask",       EbvSubgroupLtMask2,     symbolTable);
+
+            // GL_NV_shader_sm_builtins
+            symbolTable.setVariableExtensions("gl_WarpsPerSMNV",         1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMCountNV",            1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_WarpIDNV",             1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMIDNV",               1, &E_GL_NV_shader_sm_builtins);
+            BuiltInVariable("gl_WarpsPerSMNV",          EbvWarpsPerSM,      symbolTable);
+            BuiltInVariable("gl_SMCountNV",             EbvSMCount,         symbolTable);
+            BuiltInVariable("gl_WarpIDNV",              EbvWarpID,          symbolTable);
+            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
         }
 
         if ((profile != EEsProfile && version >= 140) ||
@@ -8800,6 +8839,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_SubgroupGtMask",       EbvSubgroupGtMask2,     symbolTable);
             BuiltInVariable("gl_SubgroupLeMask",       EbvSubgroupLeMask2,     symbolTable);
             BuiltInVariable("gl_SubgroupLtMask",       EbvSubgroupLtMask2,     symbolTable);
+
+            // GL_NV_shader_sm_builtins
+            symbolTable.setVariableExtensions("gl_WarpsPerSMNV",         1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMCountNV",            1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_WarpIDNV",             1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMIDNV",               1, &E_GL_NV_shader_sm_builtins);
+            BuiltInVariable("gl_WarpsPerSMNV",          EbvWarpsPerSM,      symbolTable);
+            BuiltInVariable("gl_SMCountNV",             EbvSMCount,         symbolTable);
+            BuiltInVariable("gl_WarpIDNV",              EbvWarpID,          symbolTable);
+            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
         }
         break;
 
@@ -8934,6 +8983,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_SubgroupLtMask",       EbvSubgroupLtMask2,     symbolTable);
 
             symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic);
+
+            // GL_NV_shader_sm_builtins
+            symbolTable.setVariableExtensions("gl_WarpsPerSMNV",         1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMCountNV",            1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_WarpIDNV",             1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMIDNV",               1, &E_GL_NV_shader_sm_builtins);
+            BuiltInVariable("gl_WarpsPerSMNV",          EbvWarpsPerSM,      symbolTable);
+            BuiltInVariable("gl_SMCountNV",             EbvSMCount,         symbolTable);
+            BuiltInVariable("gl_WarpIDNV",              EbvWarpID,          symbolTable);
+            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
         }
         break;
 
@@ -9024,6 +9083,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_SubgroupLtMask",       EbvSubgroupLtMask2,     symbolTable);
 
             symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic);
+
+            // GL_NV_shader_sm_builtins
+            symbolTable.setVariableExtensions("gl_WarpsPerSMNV",         1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMCountNV",            1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_WarpIDNV",             1, &E_GL_NV_shader_sm_builtins);
+            symbolTable.setVariableExtensions("gl_SMIDNV",               1, &E_GL_NV_shader_sm_builtins);
+            BuiltInVariable("gl_WarpsPerSMNV",          EbvWarpsPerSM,      symbolTable);
+            BuiltInVariable("gl_SMCountNV",             EbvSMCount,         symbolTable);
+            BuiltInVariable("gl_WarpIDNV",              EbvWarpID,          symbolTable);
+            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
         }
         break;
 #endif

+ 3 - 2
3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp

@@ -1165,8 +1165,9 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
                             error(arguments->getLoc(), message, "readonly", "");
                         if (argQualifier.writeonly && ! formalQualifier.writeonly)
                             error(arguments->getLoc(), message, "writeonly", "");
-                        if (!builtIn && argQualifier.restrict && ! formalQualifier.restrict)
-                            error(arguments->getLoc(), message, "restrict", "");
+                        // Don't check 'restrict', it is different than the rest:
+                        // "...but only restrict can be taken away from a calling argument, by a formal parameter that
+                        // lacks the restrict qualifier..."
                     }
                     if (!builtIn && argQualifier.layoutFormat != formalQualifier.layoutFormat) {
                         // we have mismatched formats, which should only be allowed if writeonly

+ 2 - 0
3rdparty/glslang/glslang/MachineIndependent/Versions.cpp

@@ -251,6 +251,7 @@ void TParseVersions::initializeExtensionBehavior()
 #endif
 
     extensionBehavior[E_GL_NV_cooperative_matrix]                    = EBhDisable;
+    extensionBehavior[E_GL_NV_shader_sm_builtins]                    = EBhDisable;
 
     // AEP
     extensionBehavior[E_GL_ANDROID_extension_pack_es31a]             = EBhDisable;
@@ -459,6 +460,7 @@ void TParseVersions::getPreamble(std::string& preamble)
         preamble +=
             "#define GL_EXT_device_group 1\n"
             "#define GL_EXT_multiview 1\n"
+            "#define GL_NV_shader_sm_builtins 1\n"
             ;
     }
 

+ 1 - 0
3rdparty/glslang/glslang/MachineIndependent/Versions.h

@@ -228,6 +228,7 @@ const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
 #endif
 
 const char* const E_GL_NV_cooperative_matrix                    = "GL_NV_cooperative_matrix";
+const char* const E_GL_NV_shader_sm_builtins                    = "GL_NV_shader_sm_builtins";
 
 // AEP
 const char* const E_GL_ANDROID_extension_pack_es31a             = "GL_ANDROID_extension_pack_es31a";

+ 2 - 0
3rdparty/glslang/gtests/Spv.FromFile.cpp

@@ -410,6 +410,8 @@ INSTANTIATE_TEST_CASE_P(
         "spv.xfb2.vert",
         "spv.xfb3.vert",
         "spv.samplerlessTextureFunctions.frag",
+        "spv.smBuiltins.vert",
+        "spv.smBuiltins.frag",
     })),
     FileNameAsCustomTestSuffix
 );

+ 1 - 1
3rdparty/glslang/known_good.json

@@ -5,7 +5,7 @@
       "site" : "github",
       "subrepo" : "KhronosGroup/SPIRV-Tools",
       "subdir" : "External/spirv-tools",
-      "commit" : "2c0111e6eba779cf30e8c7f5a733ea0762895ba0"
+      "commit" : "b4bf7bcf0ad3a7eb6857e8d6d594e23f1be6f27a"
     },
     {
       "name" : "spirv-tools/external/spirv-headers",