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!
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 @@
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;
}