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-19 20:25:28 -07:00
parent c0eb058728
commit 0e38cc770d
4 changed files with 5 additions and 5 deletions

View File

@@ -278,7 +278,7 @@ public:
mg_printf(conn, kSuccessHeader.c_str(), "application/text");
if (true) {
auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_1);
auto context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0);
spv_text text = nullptr;
const uint32_t options = SPV_BINARY_TO_TEXT_OPTION_INDENT |
SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES;