radv,aco: fix legacy vertex attributes when offset >= stride on GFX6-7

The indexing needs to be adjusted and the best solution seems to
use soffset instead of const_offset, it's simpler and generate less
prologs than passing the vertex binding strides to the prolog.

Fixes dEQP-VK.pipeline.*.vertex_input.legacy_vertex_attributes.*stride_1*.

Fixes: 38cbc3c605 ("radv: advertise VK_EXT_legacy_vertex_attributes")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31209>
(cherry picked from commit 15b1790a1e)
This commit is contained in:
Samuel Pitoiset 2024-09-17 16:16:42 +02:00 committed by Eric Engestrom
parent f35ed83b82
commit 0a9bd16602
2 changed files with 5 additions and 5 deletions

View file

@ -14,7 +14,7 @@
"description": "radv,aco: fix legacy vertex attributes when offset >= stride on GFX6-7",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "38cbc3c605ff17c813e70521f4a6c8d3a5d1e397",
"notes": null

View file

@ -12889,7 +12889,7 @@ load_unaligned_vs_attrib(Builder& bld, PhysReg dst, Operand desc, Operand index,
} else {
for (unsigned i = 0; i < size; i++) {
Definition def(i ? scratch.advance(i * 4 - 4) : dst, v1);
bld.mubuf(aco_opcode::buffer_load_ubyte, def, desc, index, Operand::c32(0u), offset + i,
bld.mubuf(aco_opcode::buffer_load_ubyte, def, desc, index, Operand::c32(offset + i), 0,
false, true);
}
}
@ -13072,11 +13072,11 @@ select_vs_prolog(Program* program, const struct aco_vs_prolog_info* pinfo, ac_sh
else if (vtx_info->chan_byte_size == 8)
bld.mtbuf(aco_opcode::tbuffer_load_format_xy,
Definition(dest.advance(j * 8u), v2), Operand(cur_desc, s4),
fetch_index, Operand::c32(0u), dfmt, nfmt, offset, false, true);
fetch_index, Operand::c32(offset), dfmt, nfmt, 0, false, true);
else
bld.mtbuf(aco_opcode::tbuffer_load_format_x, Definition(dest.advance(j * 4u), v1),
Operand(cur_desc, s4), fetch_index, Operand::c32(0u), dfmt, nfmt,
offset, false, true);
Operand(cur_desc, s4), fetch_index, Operand::c32(offset), dfmt, nfmt,
0, false, true);
}
unsigned slots = vtx_info->chan_byte_size == 8 && vtx_info->num_channels > 2 ? 2 : 1;