-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSL: Shader input overrides are not applied for block, array, and struct types #2305
Comments
Got a fix for the Flat propagation. For the composites with override, there are many bugs. One of them is that OpLoad is too naive and only looks at the raw OpVariable.
Need to rewrite all this junk ... |
dboyan
added a commit
to dboyan/SPIRV-Cross
that referenced
this issue
Feb 26, 2025
As in KhronosGroup#2305, the current logic cannot properly apply input override on composite types in interface block. This change fixes the common case where the composite types are flattened into the interface block. The typing override is decoupled from location calculation so that it can be applied to all members. In the meantime, some common logics are consolidated.
dboyan
added a commit
to dboyan/SPIRV-Cross
that referenced
this issue
Feb 26, 2025
As in KhronosGroup#2305, the current logic cannot properly apply input override on composite types in interface block. This change fixes the common case where the composite types are flattened into the interface block. The typing override is decoupled from location calculation so that it can be applied to all members. In the meantime, some common logics are consolidated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found this during investigation of Vulkan CTS failures related KhronosGroup/MoltenVK#2116. For the following fragment inputs shader input overrides are not applied at all. Setting breakpoints on all usages of
inputs_by_location
shows that none of those codepaths are taken.This generates the following MSL, regardless whether
--msl-shader-input 1 any32 4
(which should widen the firstint3
toint4
) was specified. Also, theflat
specifier is not being propagated properly.Note that this is a more complicated example, as this uses a struct within an array within a block, but as soon as any fragment inputs are within a block the shader inputs are ignored and not applied. Same happens with structs and arrays.
Shader outputs for the vertex shader using the same setup but for stage outputs are generated correctly.
I've attached a sample fragment shader that uses the above input setup:
17782185548125675323.spv.zip
This is the simplest example using just a block as shown above which also fails:
215374844162041042.spv.zip
And the tessellation shader with the same setup, where the shader outputs work correctly, if useful for debugging:
15478294089967604931.spv.zip
The text was updated successfully, but these errors were encountered: