matdbg: use GLSL 4.5 on desktop when debugging spirv

GLSL 4.5 is closer to spriv than 4.1 and since this is just to 
"interpret" the spirv, 4.5 is fine.

Set the default precision for GLES though.
This commit is contained in:
Mathias Agopian
2023-01-31 17:24:00 -08:00
committed by Mathias Agopian
parent b940fc9c48
commit 0b4d32bf98

View File

@@ -94,11 +94,14 @@ CString ShaderExtractor::spirvToGLSL(ShaderModel shaderModel, const uint32_t* da
if (shaderModel == ShaderModel::MOBILE) {
emitOptions.es = true;
emitOptions.version = 310;
emitOptions.fragment.default_float_precision = CompilerGLSL::Options::Precision::Mediump;
emitOptions.fragment.default_int_precision = CompilerGLSL::Options::Precision::Mediump;
} else if (shaderModel == ShaderModel::DESKTOP) {
emitOptions.es = false;
emitOptions.version = 410;
emitOptions.version = 450;
}
emitOptions.vulkan_semantics = true;
//emitOptions.emit_line_directives = true;
std::vector<uint32_t> spirv(data, data + wordCount);
CompilerGLSL glslCompiler(std::move(spirv));