filamat: generate spirv 1.0 rather than spirv 1.3

Since we are still on Vulkan 1.0, we cannot use SPIR-V 1.3.
If we try to do so, this error is generated:

    Invalid SPIR-V binary version 1.3 for target environment SPIR-V 1.0

In non-optimized builds, we were already generating spirv 1.0, but
when we enabled the shader optimizer, we generated spirv 1.3.

This bug has actually been around forever, but we did not notice because
we were only invoking the optimizer in release builds, which does not
enable validation.

We cannot upgrade Vulkan 1.1 because the latest LunarG SDK for macOS
does not support it.
This commit is contained in:
Philip Rideout
2020-05-21 08:41:53 -07:00
parent c0eb058728
commit 0e38cc770d
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -304,7 +304,7 @@ void GLSLPostProcessor::fullOptimization(const TShader& tShader,
GlslangToSpv(*tShader.getIntermediate(), spirv, &options);
// Run the SPIR-V optimizer
Optimizer optimizer(SPV_ENV_UNIVERSAL_1_3);
Optimizer optimizer(SPV_ENV_UNIVERSAL_1_0);
optimizer.SetMessageConsumer([](spv_message_level_t level,
const char* source, const spv_position_t& position, const char* message) {
utils::slog.e << stringifySpvOptimizerMessage(level, source, position, message)