Mesa (main): aco: fix loading 64-bit inputs with fragment shaders
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Oct 21 15:17:46 UTC 2021
Module: Mesa
Branch: main
Commit: 996e81fb70419bdf0e7bb9afea18c142897730dc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=996e81fb70419bdf0e7bb9afea18c142897730dc
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Tue Oct 19 09:16:20 2021 +0200
aco: fix loading 64-bit inputs with fragment shaders
Fixes a bunch of 64-bit IO tests with piglit and Zink.
Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13454>
---
src/amd/compiler/aco_instruction_selection.cpp | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index cd36e8be1eb..5f1648eee56 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -5284,16 +5284,22 @@ visit_load_input(isel_context* ctx, nir_intrinsic_instr* instr)
}
}
- if (instr->dest.ssa.num_components == 1) {
+ if (instr->dest.ssa.num_components == 1 &&
+ instr->dest.ssa.bit_size != 64) {
bld.vintrp(aco_opcode::v_interp_mov_f32, Definition(dst), Operand::c32(vertex_id),
bld.m0(prim_mask), idx, component);
} else {
+ unsigned num_components = instr->dest.ssa.num_components;
+ if (instr->dest.ssa.bit_size == 64)
+ num_components *= 2;
aco_ptr<Pseudo_instruction> vec{create_instruction<Pseudo_instruction>(
- aco_opcode::p_create_vector, Format::PSEUDO, instr->dest.ssa.num_components, 1)};
- for (unsigned i = 0; i < instr->dest.ssa.num_components; i++) {
+ aco_opcode::p_create_vector, Format::PSEUDO, num_components, 1)};
+ for (unsigned i = 0; i < num_components; i++) {
+ unsigned chan_component = (component + i) % 4;
+ unsigned chan_idx = idx + (component + i) / 4;
vec->operands[i] = bld.vintrp(
aco_opcode::v_interp_mov_f32, bld.def(instr->dest.ssa.bit_size == 16 ? v2b : v1),
- Operand::c32(vertex_id), bld.m0(prim_mask), idx, component + i);
+ Operand::c32(vertex_id), bld.m0(prim_mask), chan_idx, chan_component);
}
vec->definitions[0] = Definition(dst);
bld.insert(std::move(vec));
More information about the mesa-commit
mailing list