Open s-perron opened 9 months ago
@ShchchowAMD Do you have any idea how this is suppose to work?
I checked how the code is generated in glsl. The type for fp_h[2]
is correct. The problem is in these lines:
The code assumes that is can add the index for GetAttributeAtVertex by appending another index to the end of the access chain, but in this case that is wrong. It needs to place the index before the index into the array, which is already generated.
Sorry for the late reply, I'll take a look and give a fix soon. Thanks!
Description The SPIR-V code generated by DXC when an array is marked with
nointerpolation
seems broken. It looks like internally we are inconsistent in how we expand the array into a two dimensional array.Steps to Reproduce
I tried a number of examples, and they all fail. Here is one example: https://godbolt.org/z/dahbcj3EE.
Actual Behavior
The spir-v of interest is:
Note that we have an array of size 3 containing the array of size 2. This means that the order of the access chains should be
The first access chain looks correct. The provoking vertex is 0, and we want index 1 in the array. However, the second access chain has the indices backwards. I would expect vertex 2 at index 0. This is probably due to the array access being on the input to
GetAttributeAtVertex
instead of the output. However, if I move[0]
to be applied to the return value ofGetAttributeAtVertex
, there is a compilation error.There seems to be a design issue here.
Environment
GetAttributeAtVertex
was enabled for spir-v.)