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!
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user