Please find a small reproducible application and referenced SPIR-V files on Github
VkCreateShaderModule with shader-broken.spirv file crashes with the following error:
Exception thrown at 0x00007FFBC2171722 (amdvlk64.dll) in main.exe: 0xC0000005: Access violation reading location 0x0000000000000008.
shader-broken.spirv is generated with my C -> SPIR-V compiler hcc
In shader-broken.spirv, the OpVariable with a Output storage class and a structure data type, is causing the crash. In shader-works.spirv, I removed these and their related instructions using a hex editor and it does not crash anymore.
%5 = OpVariable %_ptr_Output__struct_52 Output %40 = OpVariable %_ptr_Output__struct_39 Output
This does work when i use Linux on the same machine, so it is something specific to the AMD Vulkan driver for Windows 11.
I have not seen any other compiler (such as dxc or glslc) that uses structure types in OpVariable with Output or Input storage classes but the SPIR-V spec does support it.
An OpVariable with an Input storage class that uses a structure type does work fine, so it is specifically to do with the Output storage class.
AMD Radeon RX 6600
I just asked someone else to test on Windows 10 using an AMD 6600 XT and they encounter the same issue crashing inside VkCreateShaderModule:
AMD 6600 XT
AMD drivers v22.11.2
Windows10 22H2 (19045.2965)
they are going to update their drivers and try again. they are using the sample application on my C -> SPIR-V compiler https://github.com/heroseh/hcc/releases/tag/0.0.3 samples/samples.exe
and got this stacktrace: https://pastebin.com/TSg7ugT2
I got another person to test on Windows 10 22H2 using an AMD RX 6600 XT on drivers 31.0.14051.5006 and they encounter the same crash in VkCreateShaderModule.
hope that helps, thank you!
The cards that have been playing up all are RDNA 2 on both Windows 10 & 11. Tested cards showing this issue: RX 6600, RX 6600 XT and the 680M
C -> SPIR-V compiler: https://github.com/heroseh/hcc/releases/tag/0.0.3 samples/samples.exe
or the minimal test app: https://github.com/heroseh/hcc-amd-vulkan-driver-crash