mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-26 23:55:46 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user