agx: Require 32-bit alignment for EOT offset

Fixes piles of brokenness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
This commit is contained in:
Alyssa Rosenzweig
2023-10-04 11:25:36 -04:00
committed by Marge Bot
parent 7d7f5013f8
commit 5b754410da
2 changed files with 13 additions and 8 deletions

View File

@@ -653,16 +653,21 @@ agx_emit_block_image_store(agx_builder *b, nir_intrinsic_instr *instr)
bool array = nir_intrinsic_image_array(instr); bool array = nir_intrinsic_image_array(instr);
enum agx_dim dim = agx_tex_dim(nir_intrinsic_image_dim(instr), array); enum agx_dim dim = agx_tex_dim(nir_intrinsic_image_dim(instr), array);
/* 32-bit source physically, 16-bit in NIR, top half ignored but needed
* logically to ensure alignment.
*/
offset = agx_vec2(b, offset, agx_undef(AGX_SIZE_16));
offset.size = AGX_SIZE_32;
/* Modified coordinate descriptor */ /* Modified coordinate descriptor */
agx_index coords; agx_index coords;
if (array) { if (array) {
coords = agx_temp(b->shader, AGX_SIZE_32); coords = agx_temp(b->shader, AGX_SIZE_32);
agx_emit_collect_to( agx_emit_collect_to(b, coords, 2,
b, coords, 2, (agx_index[]){
(agx_index[]){ ms ? agx_mov_imm(b, 16, 0) : layer,
ms ? agx_mov_imm(b, 16, 0) : layer, ms ? layer : agx_undef(AGX_SIZE_16),
ms ? layer : agx_mov_imm(b, 16, 0xFFFF) /* TODO: Why can't zero? */, });
});
} else { } else {
coords = agx_null(); coords = agx_null();
} }

View File

@@ -895,8 +895,8 @@ agx_pack_instr(struct util_dynarray *emission, struct util_dynarray *fixups,
unsigned C = I->src[2].value; unsigned C = I->src[2].value;
agx_index offset = I->src[1]; agx_index offset = I->src[1];
assert(offset.type == AGX_INDEX_REGISTER); assert(offset.size == AGX_SIZE_32);
assert(offset.size == AGX_SIZE_16); assert_register_is_aligned(offset);
unsigned R = offset.value; unsigned R = offset.value;
bool unk1 = true; bool unk1 = true;