powervr-graphics / Native_SDK

C++ cross-platform 3D graphics SDK. Includes demos & helper code (resource loading etc.) to speed up development of Vulkan, OpenGL ES 2.0 & 3.x applications
https://docs.imgtec.com/sdk-documentation/html/introduction.html
MIT License
702 stars 197 forks source link

[BUG] Some Vulkan examples failing shader compilation on macOS with MoltenVk due to spvSwizzleConstants being undefined #67

Open lilly-lizard opened 3 years ago

lilly-lizard commented 3 years ago

Some of the Vulkan SDK examples are failing shader compilation on macos (catalina 10.15.7) with lunarg sdk 1.2.176.1 due to spvSwizzleConstants being undeclared. This is presumably a SPIRV-Cross bug, but further investigation is needed before we submit an issue there.

Affected examples: IntroducingPVRUtils, DeferredShading, GnomeHorde, MultiSampling, Navigation3D, PipelineCache

Error message for IntroducingPVRUtils:

[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
Compilation failed: 

program_source:82:35: error: use of undeclared identifier 'spvSwizzleConstants'
    constant uint& sTextureSwzl = spvSwizzleConstants[0];
                                  ^
.
[mvk-error] VK_ERROR_INVALID_SHADER_NV: Fragment shader function could not be compiled into pipeline. See previous logged error.

The other affected examples have the same use of undeclared identifier 'spvSwizzleConstants' error.