Skip to content

shader: Handle the created input array like an overlapping array

Gert Wollny requested to merge gerddie/virglrenderer:fix-layout-rework into master

shader: Handle the forced input array like an overlapping array

With NTT the guest no longer sends array info, so if we have indirect access to IO variables, then we create an array replacing the normal generic and patch IO variables, and in order to match shader interfaces, we also sometimes have to declare an input array because the previous shader stage requires an output array.

Sometimes a TES will not read all inputs of a TCS, and in the guest NIR will not emit declarations for the inputs that are not read, so that we may end up with declaring an input array that uses more elements than what we see from the TGSI, and if the first element that is actually read is not at generic or patch location zero, we were not reading the right input.

With the new layout handling, that allows redirecting a declared input to another declared or array we must handle these force- created arrays the same way, and redirect the access to all inputs to this array, taking the offsets into the arrays into account.

In addition do code cleanups and also handle patches when matching interfaces.

Fixes: c89badf6 shader: merge overlapping arrays and always emit vec4 generics

Related: mesa/mesa#6481

Edited by Gert Wollny

Merge request reports