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");
{
}
-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
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;