diff options
author | Gert Wollny <[email protected]> | 2020-05-10 20:19:25 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-19 07:52:13 +0000 |
commit | 7ae4b7938e80c71b3b06f9eab26c7cab46a5d308 (patch) | |
tree | 1a116dc0440e3d89790c7f55a0a7023e13571aa5 /src/gallium/drivers/r600 | |
parent | 7c247f505c253f6f2eb6652f176e21681219734c (diff) |
r600/sfn: SSBO: Fix query of dest components
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5085>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/sfn/sfn_emitssboinstruction.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/r600/sfn/sfn_emitssboinstruction.cpp b/src/gallium/drivers/r600/sfn/sfn_emitssboinstruction.cpp index 5d022e9ab6d..d4879138a85 100644 --- a/src/gallium/drivers/r600/sfn/sfn_emitssboinstruction.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_emitssboinstruction.cpp @@ -198,8 +198,8 @@ bool EmitSSBOInstruction::emit_load_ssbo(const nir_intrinsic_instr* instr) /* TODO fix resource index */ auto ir = new FetchInstruction(dest, addr_temp, R600_IMAGE_REAL_RESOURCE_OFFSET, from_nir(instr->src[0], 0), - formats[instr->num_components-1], vtx_nf_int); - ir->set_dest_swizzle(dest_swt[instr->num_components - 1]); + formats[nir_dest_num_components(instr->dest) - 1], vtx_nf_int); + ir->set_dest_swizzle(dest_swt[nir_dest_num_components(instr->dest) - 1]); ir->set_flag(vtx_use_tc); emit_instruction(ir); @@ -210,7 +210,7 @@ bool EmitSSBOInstruction::emit_store_ssbo(const nir_intrinsic_instr* instr) { GPRVector::Swizzle swz = {7,7,7,7}; - for (int i = 0; i < instr->src[0].ssa->num_components; ++i) + for (unsigned i = 0; i < nir_src_num_components(instr->src[0]); ++i) swz[i] = i; auto orig_addr = from_nir(instr->src[2], 0); @@ -243,12 +243,12 @@ bool EmitSSBOInstruction::emit_store_ssbo(const nir_intrinsic_instr* instr) #else auto values = vec_from_nir_with_fetch_constant(instr->src[0], - (1 << instr->src[0].ssa->num_components) - 1, {0,1,2,3}, true); + (1 << nir_src_num_components(instr->src[0])) - 1, {0,1,2,3}, true); emit_instruction(new RatInstruction(cf_mem_rat, RatInstruction::STORE_TYPED, values, addr_vec, 0, rat_id, 1, 1, 0, false)); - for (int i = 1; i < instr->src[0].ssa->num_components; ++i) { + for (unsigned i = 1; i < nir_src_num_components(instr->src[0]); ++i) { emit_instruction(new AluInstruction(op1_mov, values.reg_i(0), from_nir(instr->src[0], i), write)); emit_instruction(new AluInstruction(op2_add_int, addr_vec.reg_i(0), {addr_vec.reg_i(0), Value::one_i}, last_write)); |