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

@@ -106,7 +106,7 @@ CString ShaderExtractor::spirvToGLSL(const uint32_t* data, size_t wordCount) {
// but please do not submit. We prefer to use the syntax that the standalone "spirv-dis" tool
// uses, which lets us easily generate test cases for the spirv-cross project.
CString ShaderExtractor::spirvToText(const uint32_t* begin, size_t wordCount) {
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3);
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_0);
if (SPV_SUCCESS != spvValidateBinary(context, begin, wordCount, nullptr)) {
spvContextDestroy(context);
return CString("Validation failure.");