From: Gert Wollny Date: Wed, 6 May 2020 21:51:09 +0000 (+0200) Subject: r600/sfn: Fix GDS assembly emission X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8977946aa2aba6652e847fdfdb499c7da3a25b42;p=mesa.git r600/sfn: Fix GDS assembly emission Signed-off-by: Gert Wollny Reviewed-by: Reviewed-by: Dave Airlie Part-of: --- diff --git a/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp b/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp index 8197e01dda4..4898d5b2a8e 100644 --- a/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp @@ -935,31 +935,27 @@ bool AssemblyFromShaderLegacyImpl::emit_gds(const GDSInstr& instr) memset(&gds, 0, sizeof(struct r600_bytecode_gds)); gds.op = ds_opcode_map.at(instr.op()); - gds.dst_gpr = instr.dest_sel(); - gds.uav_id = (uav_idx >= 0 ? uav_idx : 0) + instr.uav_base(); - gds.uav_index_mode = uav_idx >= 0 ? bim_none : bim_one; - gds.src_gpr = instr.src_sel(); + gds.dst_gpr = instr.dest_sel(); + gds.uav_id = (uav_idx >= 0 ? uav_idx : 0) + instr.uav_base(); + gds.uav_index_mode = uav_idx >= 0 ? bim_none : bim_one; + gds.src_gpr = instr.src_sel(); - if (instr.op() == DS_OP_CMP_XCHG_RET) { - gds.src_sel_z = 1; - } else { - gds.src_sel_z = 7; - } + gds.src_sel_x = instr.src_swizzle(0); + gds.src_sel_y = instr.src_swizzle(1); + gds.src_sel_z = instr.src_swizzle(2); - gds.src_sel_x = instr.src_swizzle(0); - gds.src_sel_y = instr.src_swizzle(1); - - gds.dst_sel_x = 0; - gds.dst_sel_y = 7; - gds.dst_sel_z = 7; - gds.dst_sel_w = 7; - gds.src_gpr2 = 0; - gds.alloc_consume = 1; // Not Cayman + gds.dst_sel_x = instr.dest_swizzle(0); + gds.dst_sel_y = 7; + gds.dst_sel_z = 7; + gds.dst_sel_w = 7; + gds.src_gpr2 = 0; + gds.alloc_consume = 1; // Not Cayman int r = r600_bytecode_add_gds(m_bc, &gds); - if (r) - return false; - m_bc->cf_last->vpm = 1; + if (r) + return false; + m_bc->cf_last->vpm = 1; + m_bc->cf_last->barrier = 1; return true; }