KhronosGroup / MoltenVK

MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
Apache License 2.0
4.85k stars 429 forks source link

Storage buffer compilation issues in 1.3.296 #2380

Open TheMostDiligent opened 1 month ago

TheMostDiligent commented 1 month ago

After updating from 1.3.290 to 1.3.296, we are now seeing the following errors when compiling shaders that previously worked OK:

[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
program_source:96:53: error: must use 'struct' tag to refer to type 'g_Particles' in this scope
    const device auto& g_Particles = *(const device g_Particles* )((const device char* )spvDescriptorSet0.g_Particles + spvDynamicOffsets[1]);
                                                    ^
                                                    struct 
program_source:96:24: note: struct 'g_Particles' is hidden by a non-type declaration of 'g_Particles' here
    const device auto& g_Particles = *(const device g_Particles* )((const device char* )spvDescriptorSet0.g_Particles + spvDynamicOffsets[1]);
                       ^
.
Diligent Engine: ERROR: Vulkan debug message (validation): mvk-error
                 VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
program_source:96:53: error: must use 'struct' tag to refer to type 'g_Particles' in this scope
    const device auto& g_Particles = *(const device g_Particles* )((const device char* )spvDescriptorSet0.g_Particles + spvDynamicOffsets[1]);
                                                    ^
                                                    struct 
program_source:96:24: note: struct 'g_Particles' is hidden by a non-type declaration of 'g_Particles' here
    const device auto& g_Particles = *(const device g_Particles* )((const device char* )spvDescriptorSet0.g_Particles + spvDynamicOffsets[1]);
                       ^
.
                 Object[0] (shader module): Handle 0x13ceacca0, Name: 'Particle VS'

[mvk-error] VK_ERROR_INVALID_SHADER_NV: Vertex shader function could not be compiled into pipeline. See previous logged error.
Diligent Engine: ERROR: Vulkan debug message (validation): mvk-error
                 VK_ERROR_INVALID_SHADER_NV: Vertex shader function could not be compiled into pipeline. See previous logged error.
                 Object[0] (pipeline): Handle 0x13d0d3e00

Tutorial14_ComputeShader.zip

billhollings commented 1 month ago

Thanks for posting the test app. Unfortunately, there seems to be a number of hardcoded paths within the app that cause it to crash immediately.

Tutorial startup log dyld[34962]: Library not loaded: @rpath/libGraphicsEngineOpenGL.dylib Referenced from: <9FB6FE9F-8F69-3538-8168-5F734710E68C> /Users/bill/Documents/Dev/iOSProjects/Molten/Support/2024/MVK_2380/Tutorial14_ComputeShader.app/Contents/MacOS/Tutorial14_ComputeShader Reason: tried: '/usr/lib/system/introspection/libGraphicsEngineOpenGL.dylib' (no such file, not in dyld cache), '/Users/egor/VulkanSDK/1.3.296.0/macOS/lib/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/VulkanSDK/1.3.296.0/macOS/lib/libGraphicsEngineOpenGL.dylib' (no such file), '/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineOpenGL/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineOpenGL/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineVulkan/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineVulkan/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/Users/egor/git/DiligentEngine/build/MacOS/DiligentCorePro/Graphics/GraphicsEngineMetal/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/git/DiligentEngine/build/MacOS/DiligentCorePro/Graphics/GraphicsEngineMetal/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/Users/egor/VulkanSDK/1.3.296.0/macOS/lib/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/VulkanSDK/1.3.296.0/macOS/lib/libGraphicsEngineOpenGL.dylib' (no such file), '/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineOpenGL/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineOpenGL/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineVulkan/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/git/DiligentEngine/build/MacOS/DiligentCore/Graphics/GraphicsEngineVulkan/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/Users/egor/git/DiligentEngine/build/MacOS/DiligentCorePro/Graphics/GraphicsEngineMetal/Debug/libGraphicsEngineOpenGL.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/egor/git/DiligentEngine/build/MacOS/DiligentCorePro/Graphics/GraphicsEngineMetal/Debug/libGraphicsEngineOpenGL.dylib' (no such file)