Zebediah Figura (@zfigura) commented about tests/entry-point-semantics.shader_test:
+todo draw quad +todo probe (0, 0) rgba (12.0, 34.0, 56.0, 78.0) + + +% Arrays (even multi-dimensional) of struct elements are allowed. The fields in the different struct +% elements get the same indexes. +[pixel shader todo] +struct apple { + float2 texcoord : TEXCOORD0; + float4 arb : UNUSED; +}; + +float4 main(in apple aps[2][2]) : sv_target +{ + return float4(aps[0][0].texcoord, aps[1][1].texcoord); +} Wow, okay, I was not expecting that to be legal.
It's also legal even without using arrays, *but* only if the types match—otherwise there's an error. We could probably add some extra tests for that. Also a test that the variables don't really alias each other might be warranted. (I.e. assigning to one only affects that one.) -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/148#note_29099