From 2cb2f197a7cad508d4fcda873aa01e2f736992b8 Mon Sep 17 00:00:00 2001 From: Daniel Koch Date: Tue, 4 Jun 2019 08:43:32 -0400 Subject: [PATCH] Add support for GL_NV_shader_sm_builtins Including spirv and AST tests Also increase size of TBuiltInVariable bitfields since we've now exceeded 127 and add a static_assert to make this easier to find next time it happens! --- SPIRV/GLSL.ext.NV.h | 3 ++ SPIRV/GlslangToSpv.cpp | 18 +++++++ SPIRV/doc.cpp | 5 ++ Test/baseResults/glsl.450.subgroup.frag.out | 22 +++++++- Test/baseResults/glsl.450.subgroup.geom.out | 22 +++++++- Test/baseResults/glsl.450.subgroup.tesc.out | 22 +++++++- Test/baseResults/glsl.450.subgroup.tese.out | 22 +++++++- Test/baseResults/glsl.450.subgroup.vert.out | 22 +++++++- Test/baseResults/glsl.450.subgroupBasic.comp.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.mesh.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.rahit.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.rcall.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.rchit.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.rgen.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.rint.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.rmiss.out | 22 +++++++- Test/baseResults/glsl.460.subgroup.task.out | 22 +++++++- Test/baseResults/spv.smBuiltins.frag.out | 50 +++++++++++++++++ Test/baseResults/spv.smBuiltins.vert.out | 62 +++++++++++++++++++++ Test/baseResults/spv.specConstant.vert.out | 6 +-- Test/glsl.450.subgroup.frag | 20 +++++++ Test/glsl.450.subgroup.geom | 20 +++++++ Test/glsl.450.subgroup.tesc | 20 +++++++ Test/glsl.450.subgroup.tese | 21 ++++++++ Test/glsl.450.subgroup.vert | 21 ++++++++ Test/glsl.450.subgroupBasic.comp | 20 +++++++ Test/glsl.460.subgroup.mesh | 21 ++++++++ Test/glsl.460.subgroup.rahit | 20 +++++++ Test/glsl.460.subgroup.rcall | 20 +++++++ Test/glsl.460.subgroup.rchit | 20 +++++++ Test/glsl.460.subgroup.rgen | 20 +++++++ Test/glsl.460.subgroup.rint | 20 +++++++ Test/glsl.460.subgroup.rmiss | 20 +++++++ Test/glsl.460.subgroup.task | 20 +++++++ Test/spv.smBuiltins.frag | 7 +++ Test/spv.smBuiltins.vert | 11 ++++ glslang/Include/BaseTypes.h | 11 ++++ glslang/Include/Types.h | 5 +- glslang/MachineIndependent/Initialize.cpp | 69 ++++++++++++++++++++++++ glslang/MachineIndependent/Versions.cpp | 2 + glslang/MachineIndependent/Versions.h | 1 + gtests/Spv.FromFile.cpp | 2 + known_good.json | 2 +- 43 files changed, 825 insertions(+), 20 deletions(-) create mode 100644 Test/baseResults/spv.smBuiltins.frag.out create mode 100644 Test/baseResults/spv.smBuiltins.vert.out create mode 100644 Test/spv.smBuiltins.frag create mode 100644 Test/spv.smBuiltins.vert diff --git a/SPIRV/GLSL.ext.NV.h b/SPIRV/GLSL.ext.NV.h index ede2c57..50146da 100644 --- a/SPIRV/GLSL.ext.NV.h +++ b/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 diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 76140a9..312e06a 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/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; } diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp index da9494d..3e68345 100644 --- a/SPIRV/doc.cpp +++ b/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"; diff --git a/Test/baseResults/glsl.450.subgroup.frag.out b/Test/baseResults/glsl.450.subgroup.frag.out index dd16c1f..e61523e 100644 --- a/Test/baseResults/glsl.450.subgroup.frag.out +++ b/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) diff --git a/Test/baseResults/glsl.450.subgroup.geom.out b/Test/baseResults/glsl.450.subgroup.geom.out index 998f6c2..baf82dc 100644 --- a/Test/baseResults/glsl.450.subgroup.geom.out +++ b/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 diff --git a/Test/baseResults/glsl.450.subgroup.tesc.out b/Test/baseResults/glsl.450.subgroup.tesc.out index fef9a04..eeee387 100644 --- a/Test/baseResults/glsl.450.subgroup.tesc.out +++ b/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! diff --git a/Test/baseResults/glsl.450.subgroup.tese.out b/Test/baseResults/glsl.450.subgroup.tese.out index de44d55..3f05d77 100644 --- a/Test/baseResults/glsl.450.subgroup.tese.out +++ b/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 diff --git a/Test/baseResults/glsl.450.subgroup.vert.out b/Test/baseResults/glsl.450.subgroup.vert.out index 8fad613..8850bf4 100644 --- a/Test/baseResults/glsl.450.subgroup.vert.out +++ b/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) diff --git a/Test/baseResults/glsl.450.subgroupBasic.comp.out b/Test/baseResults/glsl.450.subgroupBasic.comp.out index 168d80d..654138b 100644 --- a/Test/baseResults/glsl.450.subgroupBasic.comp.out +++ b/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! diff --git a/Test/baseResults/glsl.460.subgroup.mesh.out b/Test/baseResults/glsl.460.subgroup.mesh.out index c819881..bb0e4eb 100644 --- a/Test/baseResults/glsl.460.subgroup.mesh.out +++ b/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 diff --git a/Test/baseResults/glsl.460.subgroup.rahit.out b/Test/baseResults/glsl.460.subgroup.rahit.out index aba573a..0a1e4f4 100644 --- a/Test/baseResults/glsl.460.subgroup.rahit.out +++ b/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) diff --git a/Test/baseResults/glsl.460.subgroup.rcall.out b/Test/baseResults/glsl.460.subgroup.rcall.out index d6b4895..6bffdc9 100644 --- a/Test/baseResults/glsl.460.subgroup.rcall.out +++ b/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) diff --git a/Test/baseResults/glsl.460.subgroup.rchit.out b/Test/baseResults/glsl.460.subgroup.rchit.out index 14a8d84..1ea9e69 100644 --- a/Test/baseResults/glsl.460.subgroup.rchit.out +++ b/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) diff --git a/Test/baseResults/glsl.460.subgroup.rgen.out b/Test/baseResults/glsl.460.subgroup.rgen.out index a3c5bbb..dfe1e2b 100644 --- a/Test/baseResults/glsl.460.subgroup.rgen.out +++ b/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) diff --git a/Test/baseResults/glsl.460.subgroup.rint.out b/Test/baseResults/glsl.460.subgroup.rint.out index 31a8a59..9915ecf 100644 --- a/Test/baseResults/glsl.460.subgroup.rint.out +++ b/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) diff --git a/Test/baseResults/glsl.460.subgroup.rmiss.out b/Test/baseResults/glsl.460.subgroup.rmiss.out index 2ca136d..ddf7d1b 100644 --- a/Test/baseResults/glsl.460.subgroup.rmiss.out +++ b/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) diff --git a/Test/baseResults/glsl.460.subgroup.task.out b/Test/baseResults/glsl.460.subgroup.task.out index d953646..8d2a1d3 100644 --- a/Test/baseResults/glsl.460.subgroup.task.out +++ b/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! diff --git a/Test/baseResults/spv.smBuiltins.frag.out b/Test/baseResults/spv.smBuiltins.frag.out new file mode 100644 index 0000000..fda06eb --- /dev/null +++ b/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 diff --git a/Test/baseResults/spv.smBuiltins.vert.out b/Test/baseResults/spv.smBuiltins.vert.out new file mode 100644 index 0000000..8423e5b --- /dev/null +++ b/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 diff --git a/Test/baseResults/spv.specConstant.vert.out b/Test/baseResults/spv.specConstant.vert.out index 0d47dce..931ba8d 100644 --- a/Test/baseResults/spv.specConstant.vert.out +++ b/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 diff --git a/Test/glsl.450.subgroup.frag b/Test/glsl.450.subgroup.frag index 26011ed..61cfc8f 100644 --- a/Test/glsl.450.subgroup.frag +++ b/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; +} diff --git a/Test/glsl.450.subgroup.geom b/Test/glsl.450.subgroup.geom index affe045..d5d2f25 100644 --- a/Test/glsl.450.subgroup.geom +++ b/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; +} diff --git a/Test/glsl.450.subgroup.tesc b/Test/glsl.450.subgroup.tesc index a67af25..92cb1ae 100644 --- a/Test/glsl.450.subgroup.tesc +++ b/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; +} diff --git a/Test/glsl.450.subgroup.tese b/Test/glsl.450.subgroup.tese index ebfd123..bfb2b72 100644 --- a/Test/glsl.450.subgroup.tese +++ b/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; +} diff --git a/Test/glsl.450.subgroup.vert b/Test/glsl.450.subgroup.vert index 0be08b5..110b1d0 100644 --- a/Test/glsl.450.subgroup.vert +++ b/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; +} + diff --git a/Test/glsl.450.subgroupBasic.comp b/Test/glsl.450.subgroupBasic.comp index 1bcd486..7b42878 100644 --- a/Test/glsl.450.subgroupBasic.comp +++ b/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; +} diff --git a/Test/glsl.460.subgroup.mesh b/Test/glsl.460.subgroup.mesh index 19a4757..1071cac 100644 --- a/Test/glsl.460.subgroup.mesh +++ b/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; +} diff --git a/Test/glsl.460.subgroup.rahit b/Test/glsl.460.subgroup.rahit index 3ee7378..a1bce28 100644 --- a/Test/glsl.460.subgroup.rahit +++ b/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; +} diff --git a/Test/glsl.460.subgroup.rcall b/Test/glsl.460.subgroup.rcall index dc7ad2e..9c2ede8 100644 --- a/Test/glsl.460.subgroup.rcall +++ b/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; +} diff --git a/Test/glsl.460.subgroup.rchit b/Test/glsl.460.subgroup.rchit index cbe3517..aae5b54 100644 --- a/Test/glsl.460.subgroup.rchit +++ b/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; +} diff --git a/Test/glsl.460.subgroup.rgen b/Test/glsl.460.subgroup.rgen index 9184e15..a3c78c9 100644 --- a/Test/glsl.460.subgroup.rgen +++ b/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; +} diff --git a/Test/glsl.460.subgroup.rint b/Test/glsl.460.subgroup.rint index 7a58804..1909c5a 100644 --- a/Test/glsl.460.subgroup.rint +++ b/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; +} diff --git a/Test/glsl.460.subgroup.rmiss b/Test/glsl.460.subgroup.rmiss index 4d629d6..96c4411 100644 --- a/Test/glsl.460.subgroup.rmiss +++ b/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; +} diff --git a/Test/glsl.460.subgroup.task b/Test/glsl.460.subgroup.task index 84d3140..9b147f8 100644 --- a/Test/glsl.460.subgroup.task +++ b/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; +} diff --git a/Test/spv.smBuiltins.frag b/Test/spv.smBuiltins.frag new file mode 100644 index 0000000..b676e60 --- /dev/null +++ b/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); +} diff --git a/Test/spv.smBuiltins.vert b/Test/spv.smBuiltins.vert new file mode 100644 index 0000000..0b3db02 --- /dev/null +++ b/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); +} diff --git a/glslang/Include/BaseTypes.h b/glslang/Include/BaseTypes.h index e4a4572..1a99e1b 100644 --- a/glslang/Include/BaseTypes.h +++ b/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"; } } diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index 1cbf4db..989c34a 100644 --- a/glslang/Include/Types.h +++ b/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 diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index ecaf755..afaf2d6 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/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 diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 6c97da1..4054ac8 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/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" ; } diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index 953d33a..6c94502 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/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"; diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index ead5e6d..e28f7aa 100644 --- a/gtests/Spv.FromFile.cpp +++ b/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 ); diff --git a/known_good.json b/known_good.json index 9c2bb40..3053d1d 100644 --- a/known_good.json +++ b/known_good.json @@ -5,7 +5,7 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "d01a3c3b4b76e942e1c22adca5a9713197dde901" + "commit" : "0755d6ce821cb1ca1e5a5bdf3a8d1d63b08da86d" }, { "name" : "spirv-tools/external/spirv-headers", -- 2.7.4