diff --git a/src/gallium/drivers/r600/sfn/sfn_assembler.cpp b/src/gallium/drivers/r600/sfn/sfn_assembler.cpp index 0093e3e7ca3..0bb6e16f8d3 100644 --- a/src/gallium/drivers/r600/sfn/sfn_assembler.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_assembler.cpp @@ -586,9 +586,8 @@ void AssamblerVisitor::visit(const StreamOutInstr& instr) output.burst_count = instr.burst_count(); output.array_size = instr.array_size(); output.comp_mask = instr.comp_mask(); - output.op = instr.op(); + output.op = instr.op(m_shader->bc.gfx_level); - assert(output.op >= CF_OP_MEM_STREAM0_BUF0 && output.op <= CF_OP_MEM_STREAM3_BUF3); if (r600_bytecode_add_output(m_bc, &output)) { R600_ERR("shader_from_nir: Error creating stream output instruction\n"); diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp index 660de9994d4..3d40ea1796a 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp @@ -280,16 +280,21 @@ StreamOutInstr::StreamOutInstr(const RegisterVec4& value, int num_components, { } -unsigned StreamOutInstr::op() const +unsigned StreamOutInstr::op(amd_gfx_level gfx_level) const { int op = 0; - switch (m_output_buffer) { - case 0: op = CF_OP_MEM_STREAM0_BUF0; break; - case 1: op = CF_OP_MEM_STREAM0_BUF1; break; - case 2: op = CF_OP_MEM_STREAM0_BUF2; break; - case 3: op = CF_OP_MEM_STREAM0_BUF3; break; + if (gfx_level >= EVERGREEN) { + switch (m_output_buffer) { + case 0: op = CF_OP_MEM_STREAM0_BUF0; break; + case 1: op = CF_OP_MEM_STREAM0_BUF1; break; + case 2: op = CF_OP_MEM_STREAM0_BUF2; break; + case 3: op = CF_OP_MEM_STREAM0_BUF3; break; + } + return 4 * m_stream + op; + } else { + assert(m_stream == 0); + return CF_OP_MEM_STREAM0 + m_output_buffer; } - return 4 * m_stream + op; } bool StreamOutInstr::is_equal_to(const StreamOutInstr& oth) const diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_export.h b/src/gallium/drivers/r600/sfn/sfn_instr_export.h index b7b03ccf850..c88a4e3006b 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_export.h +++ b/src/gallium/drivers/r600/sfn/sfn_instr_export.h @@ -132,7 +132,7 @@ public: int array_base() const { return m_array_base;} int array_size() const { return m_array_size;} int comp_mask() const { return m_writemask;} - unsigned op() const; + unsigned op(amd_gfx_level gfx_level) const; bool is_equal_to(const StreamOutInstr& lhs) const;