summaryrefslogtreecommitdiff
path: root/spirv_parser.cpp
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-11-08 12:14:51 +0100
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-11-08 12:21:07 +0100
commite8a22a7cf655c1d259973de350e872bfc7aa606b (patch)
tree69f0a7417484e67c91abd5a22beb926e2d518f59 /spirv_parser.cpp
parentabc31207bffbc1bef4192746af44b3be1abcff17 (diff)
downloadSPIRV-Cross-e8a22a7cf655c1d259973de350e872bfc7aa606b.tar.gz
SPIRV-Cross-e8a22a7cf655c1d259973de350e872bfc7aa606b.tar.bz2
SPIRV-Cross-e8a22a7cf655c1d259973de350e872bfc7aa606b.zip
Handle ShaderDebugInfo non-semantic extension.
Diffstat (limited to 'spirv_parser.cpp')
-rw-r--r--spirv_parser.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/spirv_parser.cpp b/spirv_parser.cpp
index 49eb1933..39bd1adf 100644
--- a/spirv_parser.cpp
+++ b/spirv_parser.cpp
@@ -275,24 +275,28 @@ void Parser::parse(const Instruction &instruction)
case OpExtInstImport:
{
uint32_t id = ops[0];
+
+ SPIRExtension::Extension spirv_ext = SPIRExtension::Unsupported;
+
auto ext = extract_string(ir.spirv, instruction.offset + 1);
if (ext == "GLSL.std.450")
- set<SPIRExtension>(id, SPIRExtension::GLSL);
+ spirv_ext = SPIRExtension::GLSL;
else if (ext == "DebugInfo")
- set<SPIRExtension>(id, SPIRExtension::SPV_debug_info);
+ spirv_ext = SPIRExtension::SPV_debug_info;
else if (ext == "SPV_AMD_shader_ballot")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_shader_ballot);
+ spirv_ext = SPIRExtension::SPV_AMD_shader_ballot;
else if (ext == "SPV_AMD_shader_explicit_vertex_parameter")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter);
+ spirv_ext = SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter;
else if (ext == "SPV_AMD_shader_trinary_minmax")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_shader_trinary_minmax);
+ spirv_ext = SPIRExtension::SPV_AMD_shader_trinary_minmax;
else if (ext == "SPV_AMD_gcn_shader")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_gcn_shader);
+ spirv_ext = SPIRExtension::SPV_AMD_gcn_shader;
else if (ext == "NonSemantic.DebugPrintf")
- set<SPIRExtension>(id, SPIRExtension::NonSemanticDebugPrintf);
- else
- set<SPIRExtension>(id, SPIRExtension::Unsupported);
+ spirv_ext = SPIRExtension::NonSemanticDebugPrintf;
+ else if (ext == "NonSemantic.Shader.DebugInfo.100")
+ spirv_ext = SPIRExtension::NonSemanticShaderDebugInfo;
+ set<SPIRExtension>(id, spirv_ext);
// Other SPIR-V extensions which have ExtInstrs are currently not supported.
break;