Specifying an explicit location for an array output messes up transform feedback
@nroberts
Submitted by Neil Roberts Assigned to Intel 3D Bugs Mailing List
Link to original bug (#104360)
Description
Created attachment 136344 Test case showing the problem
There is a piglit test called arb_enhanced_layouts-transform-feedback-layout-qualifiers which tests transform feedback with a float array output like this:
layout(xfb_offset = 4) out float x2_out[2];
It verifies that the two floats in the array are written out to the XFB buffer packed tightly together. This works ok and seems to make sense. I have been trying to get this working with SPIR-V which effectively requires adding an explicit location. If you do this, then I think Mesa ends up assigning a separate location to each element of the array which means there will be three wasted components in each location. This is presumably the correct behaviour. However, this seems to be also affecting the XFB and the second element no longer gets written out.
I was thinking maybe the second would get written out with some padding in-between but this doesn’t seem to be the case. In any case on the proprietary nVidia driver it continues to write the two values out packed together even with an explicit location so I don’t think padding them out would be the correct behaviour.
Attachment 136344, "Test case showing the problem":
xfb-explicit-location.c