summaryrefslogtreecommitdiffstats
path: root/src/amd/compiler/aco_instruction_selection.cpp
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2019-09-21 16:36:32 +0100
committerRhys Perry <[email protected]>2019-10-04 22:43:11 +0100
commit77ebb030ed56f6e9a303c60311002523ae1658d0 (patch)
tree8c07ae8042ab7902aa684420661a4ab633347466 /src/amd/compiler/aco_instruction_selection.cpp
parentce76be99339a080b11de6e82ea7c1e0aa97f9f5a (diff)
aco: fix load_constant with multiple arrays
I thought I fixed this, but I guess I must have broken it again. Fixes various dEQP-VK.draw.* tests Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]>
Diffstat (limited to 'src/amd/compiler/aco_instruction_selection.cpp')
-rw-r--r--src/amd/compiler/aco_instruction_selection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 70d1258a20c..bba091fd74b 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -3242,7 +3242,7 @@ void visit_load_constant(isel_context *ctx, nir_intrinsic_instr *instr)
S_008F0C_DATA_FORMAT(V_008F0C_BUF_DATA_FORMAT_32);
}
- unsigned base = nir_intrinsic_base(instr) + ctx->constant_data_offset;
+ unsigned base = nir_intrinsic_base(instr);
unsigned range = nir_intrinsic_range(instr);
Temp offset = get_ssa_temp(ctx, instr->src[0].ssa);
@@ -3252,8 +3252,8 @@ void visit_load_constant(isel_context *ctx, nir_intrinsic_instr *instr)
offset = bld.vadd32(bld.def(v1), Operand(base), offset);
Temp rsrc = bld.pseudo(aco_opcode::p_create_vector, bld.def(s4),
- bld.sop1(aco_opcode::p_constaddr, bld.def(s2), bld.def(s1, scc), Operand(0u)),
- Operand(MIN2(range, ctx->shader->constant_data_size - nir_intrinsic_base(instr))),
+ bld.sop1(aco_opcode::p_constaddr, bld.def(s2), bld.def(s1, scc), Operand(ctx->constant_data_offset)),
+ Operand(MIN2(base + range, ctx->shader->constant_data_size)),
Operand(desc_type));
load_buffer(ctx, instr->num_components, dst, rsrc, offset);