agx: Fix storing to varying arrays

The offset is in vec4s, not words (unlike the component). This doesn't matter
right now since we get everything lowered (offset -> 0) but it will come up if
we implement clip distances natively (instead of lowering in FS).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21097>
This commit is contained in:
Alyssa Rosenzweig 2023-02-02 22:27:17 -05:00 committed by Marge Bot
parent 897c47aa1c
commit c3f7abaaef

View file

@ -423,8 +423,7 @@ agx_emit_store_vary(agx_builder *b, nir_intrinsic_instr *instr)
unsigned imm_index = b->shader->out->varyings.vs.slots[sem.location];
assert(imm_index < ~0);
imm_index += nir_intrinsic_component(instr);
imm_index += nir_src_as_uint(*offset);
imm_index += (nir_src_as_uint(*offset) * 4) + nir_intrinsic_component(instr);
/* nir_lower_io_to_scalar */
assert(nir_intrinsic_write_mask(instr) == 0x1);