Closed fknfilewalker closed 1 week ago
Can you upload the SPIR-V? I'm not going to figure out how to build and run a random project just to fish out a SPIR-V. Most likely this is caused by float3 being stride 16 in Metal and we have to figure out a way to deal with OpPtrAccessChain with arbitrary ArrayStride.
The spirv is here https://github.com/fknfilewalker/vulkan-triangle-modern/blob/sdl/src/shaders.h
Source is here https://github.com/fknfilewalker/vulkan-triangle-modern/blob/sdl/src/shaders.slang
Is this fine or do you need it in a different form?
If it's not too much to ask, either a SPIR-V asm file or raw SPIR-V is fine. Surely slang can emit a .spv?
could only share them here in a zip (includes asm as well as spv) spv.zip
Thanks. That works.
OpDecorate %_ptr_PhysicalStorageBuffer_v3float ArrayStride 12
is the culprit. If you want to workaround this in the interim, try using float4 for now. Pointer to float3 directly will be very awkward in MSL.
Using Slang v2024.1.18 and MoltenVk from SDK 1.3.283.0
Output is:
But should be:![Screenshot 2024-06-02 200220](https://github.com/KhronosGroup/SPIRV-Cross/assets/15105596/09db9c0e-bc97-419b-8da5-0a0a7427a9fe)
Use the code here to reproduce. https://github.com/fknfilewalker/vulkan-triangle-modern/tree/sdl
My guess is that the pointer arithmetic does not work correctly. So the shift here
vertices[vid]
is just 1 float.