aco: fix incorrect address calculation for load_barycentric_at_sample

Fix address calculation for indirect load_barycentric_at_sample on GFX6-8
with a uniform sample index.

A non-zero uniform sample index does not seem to be tested by CTS.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966
Fixes: 93c8ebfa78 ("aco: Initial commit of independent AMD compiler")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8302>
(cherry picked from commit b2d000513e)
This commit is contained in:
Rhys Perry 2021-01-04 10:41:39 +00:00 committed by Dylan Baker
parent 2f9e5cae2b
commit da6fb03777
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@
"description": "aco: fix incorrect address calculation for load_barycentric_at_sample",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "93c8ebfa780ebd1495095e794731881aef29e7d3"
},

View file

@ -7587,7 +7587,7 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
offset = bld.sop2(aco_opcode::s_lshl3_add_u32, bld.def(s1), bld.def(s1, scc), addr, Operand(sample_pos_offset));
} else {
offset = bld.sop2(aco_opcode::s_lshl_b32, bld.def(s1), bld.def(s1, scc), addr, Operand(3u));
offset = bld.sop2(aco_opcode::s_add_u32, bld.def(s1), bld.def(s1, scc), addr, Operand(sample_pos_offset));
offset = bld.sop2(aco_opcode::s_add_u32, bld.def(s1), bld.def(s1, scc), offset, Operand(sample_pos_offset));
}
Operand off = bld.copy(bld.def(s1), Operand(offset));