Create virtual distinction between Vulkan & GL SPIR-V. Closes #2798

* This distinction unfortunately does not exist in SPIR-V so we have to carry
  around this metadata ourselves. Rather than allowing free specification of
  tools based on API, instead pretend that Vulkan and GL SPIR-V are separate
  format, and duplicate all SPIR-V tools to handle "both" types. This allows
  appropriate tool selection based on the encoding.
This commit is contained in:
baldurk
2022-12-27 13:39:44 +00:00
parent b5545d52f8
commit 0acb955e19
13 changed files with 151 additions and 63 deletions
+3 -3
View File
@@ -68,7 +68,7 @@ static bool CheckForSupport(ShaderEncoding encoding)
return true;
}
if(encoding == ShaderEncoding::SPIRV)
if(encoding == ShaderEncoding::SPIRV || encoding == ShaderEncoding::OpenGLSPIRV)
{
// TODO need to check if an AMD context is running
rdcstr amdspv = LocatePluginFile(pluginPath, amdspv_name);
@@ -104,7 +104,7 @@ static void GetEncodings(GraphicsAPI api, ShaderEncoding &primary, ShaderEncodin
else if(api == GraphicsAPI::OpenGL)
{
primary = ShaderEncoding::GLSL;
secondary = ShaderEncoding::SPIRV;
secondary = ShaderEncoding::OpenGLSPIRV;
}
else if(api == GraphicsAPI::Vulkan)
{
@@ -531,7 +531,7 @@ rdcstr Disassemble(ShaderEncoding encoding, ShaderStage stage, const bytebuf &sh
if(encoding == ShaderEncoding::DXBC)
return DisassembleDXBC(shaderBytes, target);
if(encoding == ShaderEncoding::SPIRV)
if(encoding == ShaderEncoding::SPIRV || encoding == ShaderEncoding::OpenGLSPIRV)
return DisassembleSPIRV(stage, shaderBytes, target);
if(encoding == ShaderEncoding::GLSL)