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:

committed by
Marge Bot

parent
7d7f5013f8
commit
5b754410da
@@ -653,16 +653,21 @@ agx_emit_block_image_store(agx_builder *b, nir_intrinsic_instr *instr)
|
||||
bool array = nir_intrinsic_image_array(instr);
|
||||
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 */
|
||||
agx_index coords;
|
||||
if (array) {
|
||||
coords = agx_temp(b->shader, AGX_SIZE_32);
|
||||
agx_emit_collect_to(
|
||||
b, coords, 2,
|
||||
(agx_index[]){
|
||||
ms ? agx_mov_imm(b, 16, 0) : layer,
|
||||
ms ? layer : agx_mov_imm(b, 16, 0xFFFF) /* TODO: Why can't zero? */,
|
||||
});
|
||||
agx_emit_collect_to(b, coords, 2,
|
||||
(agx_index[]){
|
||||
ms ? agx_mov_imm(b, 16, 0) : layer,
|
||||
ms ? layer : agx_undef(AGX_SIZE_16),
|
||||
});
|
||||
} else {
|
||||
coords = agx_null();
|
||||
}
|
||||
|
@@ -895,8 +895,8 @@ agx_pack_instr(struct util_dynarray *emission, struct util_dynarray *fixups,
|
||||
unsigned C = I->src[2].value;
|
||||
|
||||
agx_index offset = I->src[1];
|
||||
assert(offset.type == AGX_INDEX_REGISTER);
|
||||
assert(offset.size == AGX_SIZE_16);
|
||||
assert(offset.size == AGX_SIZE_32);
|
||||
assert_register_is_aligned(offset);
|
||||
unsigned R = offset.value;
|
||||
|
||||
bool unk1 = true;
|
||||
|
Reference in New Issue
Block a user