i965: Reorder sources of the untyped atomic opcode.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 19 Mar 2015 13:12:01 +0000 (15:12 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 4 May 2015 12:05:20 +0000 (15:05 +0300)
This is consistent with the untyped surface read opcode.  From now on
all typed and untyped surface access opcodes will follow the same
pattern: src[0] will be the message payload, src[1] will be the
surface index and src[2] will be a control immediate (atomic operation
for atomic opcodes and number of vector components for surface read
and write opcodes).

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index 876fdd23d868ea79f93921eec2092d6c53ce64f6..efe05e34ae43ce12c3e7cb1e09c9b92112a00422 100644 (file)
@@ -2017,9 +2017,9 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
       case SHADER_OPCODE_UNTYPED_ATOMIC:
          assert(src[1].file == BRW_IMMEDIATE_VALUE &&
                 src[2].file == BRW_IMMEDIATE_VALUE);
-         brw_untyped_atomic(p, dst, src[0], src[2], src[1].dw1.ud,
+         brw_untyped_atomic(p, dst, src[0], src[1], src[2].dw1.ud,
                             inst->mlen, !inst->dst.is_null());
-         brw_mark_surface_used(prog_data, src[2].dw1.ud);
+         brw_mark_surface_used(prog_data, src[1].dw1.ud);
          break;
 
       case SHADER_OPCODE_UNTYPED_SURFACE_READ:
index 809011750b44a28168f8438e7719dc92f290c4fe..5e453a19f6b208e347dd10eb5839f4b740e18de0 100644 (file)
@@ -3287,7 +3287,7 @@ fs_visitor::emit_untyped_atomic(unsigned atomic_op, unsigned surf_index,
 
    /* Emit the instruction. */
    fs_inst *inst = emit(SHADER_OPCODE_UNTYPED_ATOMIC, dst, src_payload,
-                        fs_reg(atomic_op), fs_reg(surf_index));
+                        fs_reg(surf_index), fs_reg(atomic_op));
    inst->mlen = mlen;
 }
 
index 6189f1db5ccb27940e4fa710533798a79072e1a4..c6d98d584e8e7f313f6550b9f61c449baa44d6aa 100644 (file)
@@ -1471,9 +1471,9 @@ vec4_generator::generate_code(const cfg_t *cfg)
       case SHADER_OPCODE_UNTYPED_ATOMIC:
          assert(src[1].file == BRW_IMMEDIATE_VALUE &&
                 src[2].file == BRW_IMMEDIATE_VALUE);
-         brw_untyped_atomic(p, dst, src[0], src[2], src[1].dw1.ud, inst->mlen,
+         brw_untyped_atomic(p, dst, src[0], src[1], src[2].dw1.ud, inst->mlen,
                             !inst->dst.is_null());
-         brw_mark_surface_used(&prog_data->base, src[2].dw1.ud);
+         brw_mark_surface_used(&prog_data->base, src[1].dw1.ud);
          break;
 
       case SHADER_OPCODE_UNTYPED_SURFACE_READ:
index ca2a9988f6c8956687c0e16711016155368db1e9..e6ff8702d0b398343dcc15cbfb4957390919e2a3 100644 (file)
@@ -2962,7 +2962,7 @@ vec4_visitor::emit_untyped_atomic(unsigned atomic_op, unsigned surf_index,
     */
    vec4_instruction *inst = emit(SHADER_OPCODE_UNTYPED_ATOMIC, dst,
                                  brw_message_reg(0),
-                                 src_reg(atomic_op), src_reg(surf_index));
+                                 src_reg(surf_index), src_reg(atomic_op));
    inst->mlen = mlen;
 }