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
+2 -1
View File
@@ -60,6 +60,7 @@ static QMap<QString, ShaderEncoding> encodingExtensions = {
{lit("glsl"), ShaderEncoding::GLSL},
{lit("frag"), ShaderEncoding::GLSL},
{lit("spvasm"), ShaderEncoding::SPIRVAsm},
{lit("spvasm"), ShaderEncoding::OpenGLSPIRVAsm},
};
Q_DECLARE_METATYPE(Following);
@@ -4537,7 +4538,7 @@ void TextureViewer::on_customCreate_clicked()
" color_out = vec4(0,0,0,1);\n"
"}\n");
}
else if(enc == ShaderEncoding::SPIRVAsm)
else if(enc == ShaderEncoding::SPIRVAsm || enc == ShaderEncoding::OpenGLSPIRVAsm)
{
src = lit("; SPIR-V");
}