diff options
Diffstat (limited to 'thirdparty/glslang/SPIRV/disassemble.cpp')
-rw-r--r-- | thirdparty/glslang/SPIRV/disassemble.cpp | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/thirdparty/glslang/SPIRV/disassemble.cpp b/thirdparty/glslang/SPIRV/disassemble.cpp index 631173c0ec..930e799493 100644 --- a/thirdparty/glslang/SPIRV/disassemble.cpp +++ b/thirdparty/glslang/SPIRV/disassemble.cpp @@ -52,26 +52,16 @@ namespace spv { extern "C" { // Include C-based headers that don't have a namespace #include "GLSL.std.450.h" -#ifdef AMD_EXTENSIONS #include "GLSL.ext.AMD.h" -#endif - -#ifdef NV_EXTENSIONS #include "GLSL.ext.NV.h" -#endif } } const char* GlslStd450DebugNames[spv::GLSLstd450Count]; namespace spv { -#ifdef AMD_EXTENSIONS static const char* GLSLextAMDGetDebugNames(const char*, unsigned); -#endif - -#ifdef NV_EXTENSIONS static const char* GLSLextNVGetDebugNames(const char*, unsigned); -#endif static void Kill(std::ostream& out, const char* message) { @@ -82,15 +72,8 @@ static void Kill(std::ostream& out, const char* message) // used to identify the extended instruction library imported when printing enum ExtInstSet { GLSL450Inst, - -#ifdef AMD_EXTENSIONS GLSLextAMDInst, -#endif - -#ifdef NV_EXTENSIONS GLSLextNVInst, -#endif - OpenCLExtInst, }; @@ -499,37 +482,29 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, const char* name = idDescriptor[stream[word - 2]].c_str(); if (0 == memcmp("OpenCL", name, 6)) { extInstSet = OpenCLExtInst; -#ifdef AMD_EXTENSIONS } else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 || strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 || strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 || strcmp(spv::E_SPV_AMD_gcn_shader, name) == 0) { extInstSet = GLSLextAMDInst; -#endif -#ifdef NV_EXTENSIONS - }else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 || + } else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 || strcmp(spv::E_SPV_NV_geometry_shader_passthrough, name) == 0 || strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 || strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 || strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 || strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) { extInstSet = GLSLextNVInst; -#endif } unsigned entrypoint = stream[word - 1]; if (extInstSet == GLSL450Inst) { if (entrypoint < GLSLstd450Count) { out << "(" << GlslStd450DebugNames[entrypoint] << ")"; } -#ifdef AMD_EXTENSIONS } else if (extInstSet == GLSLextAMDInst) { out << "(" << GLSLextAMDGetDebugNames(name, entrypoint) << ")"; -#endif -#ifdef NV_EXTENSIONS } else if (extInstSet == GLSLextNVInst) { out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")"; -#endif } } break; @@ -648,9 +623,11 @@ static void GLSLstd450GetDebugNames(const char** names) names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid"; names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample"; names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset"; + names[GLSLstd450NMin] = "NMin"; + names[GLSLstd450NMax] = "NMax"; + names[GLSLstd450NClamp] = "NClamp"; } -#ifdef AMD_EXTENSIONS static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint) { if (strcmp(name, spv::E_SPV_AMD_shader_ballot) == 0) { @@ -692,18 +669,17 @@ static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint return "Bad"; } -#endif -#ifdef NV_EXTENSIONS static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) { if (strcmp(name, spv::E_SPV_NV_sample_mask_override_coverage) == 0 || strcmp(name, spv::E_SPV_NV_geometry_shader_passthrough) == 0 || strcmp(name, spv::E_ARB_shader_viewport_layer_array) == 0 || strcmp(name, spv::E_SPV_NV_viewport_array2) == 0 || - strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 || - strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 || - strcmp(name, spv::E_SPV_NV_mesh_shader) == 0) { + strcmp(name, spv::E_SPV_NVX_multiview_per_view_attributes) == 0 || + strcmp(name, spv::E_SPV_NV_fragment_shader_barycentric) == 0 || + strcmp(name, spv::E_SPV_NV_mesh_shader) == 0 || + strcmp(name, spv::E_SPV_NV_shader_image_footprint) == 0) { switch (entrypoint) { // NV builtins case BuiltInViewportMaskNV: return "ViewportMaskNV"; @@ -729,6 +705,8 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV"; case CapabilityMeshShadingNV: return "MeshShadingNV"; + case CapabilityImageFootprintNV: return "ImageFootprintNV"; + case CapabilitySampleMaskOverrideCoverageNV:return "SampleMaskOverrideCoverageNV"; // NV Decorations case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; @@ -745,7 +723,6 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) } return "Bad"; } -#endif void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream) { |