i965: Simplify generator code for untyped surface messages.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 22 Apr 2015 18:10:43 +0000 (21:10 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 4 May 2015 12:05:20 +0000 (15:05 +0300)
The generate_untyped_*() methods do nothing useful other than calling
the corresponding function from brw_eu_emit.c.  The calls to
brw_mark_surface_used() will go away too in a future commit.

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

index 0a637cd3b3733edcdb525564f64d1e5f2746dafc..0783754cba739976b3e97a5248cf54a65f808980 100644 (file)
@@ -638,17 +638,6 @@ private:
                                  struct brw_reg offset,
                                  struct brw_reg value);
 
-   void generate_untyped_atomic(fs_inst *inst,
-                                struct brw_reg dst,
-                                struct brw_reg payload,
-                                struct brw_reg atomic_op,
-                                struct brw_reg surf_index);
-
-   void generate_untyped_surface_read(fs_inst *inst,
-                                      struct brw_reg dst,
-                                      struct brw_reg payload,
-                                      struct brw_reg surf_index);
-
    bool patch_discard_jumps_to_fb_writes();
 
    struct brw_context *brw;
index e28f4430be80b1eec9a61990e14988d1435afbda..ff7e85fbb715e6ea9abe6765390185b13e3d257b 100644 (file)
@@ -1528,37 +1528,6 @@ fs_generator::generate_shader_time_add(fs_inst *inst,
                          prog_data->binding_table.shader_time_start);
 }
 
-void
-fs_generator::generate_untyped_atomic(fs_inst *inst, struct brw_reg dst,
-                                      struct brw_reg payload,
-                                      struct brw_reg atomic_op,
-                                      struct brw_reg surf_index)
-{
-   assert(atomic_op.file == BRW_IMMEDIATE_VALUE &&
-          atomic_op.type == BRW_REGISTER_TYPE_UD &&
-          surf_index.file == BRW_IMMEDIATE_VALUE &&
-         surf_index.type == BRW_REGISTER_TYPE_UD);
-
-   brw_untyped_atomic(p, dst, payload,
-                      surf_index, atomic_op.dw1.ud,
-                      inst->mlen, true);
-
-   brw_mark_surface_used(prog_data, surf_index.dw1.ud);
-}
-
-void
-fs_generator::generate_untyped_surface_read(fs_inst *inst, struct brw_reg dst,
-                                            struct brw_reg payload,
-                                            struct brw_reg surf_index)
-{
-   assert(surf_index.file == BRW_IMMEDIATE_VALUE &&
-         surf_index.type == BRW_REGISTER_TYPE_UD);
-
-   brw_untyped_surface_read(p, dst, payload, surf_index, inst->mlen, 1);
-
-   brw_mark_surface_used(prog_data, surf_index.dw1.ud);
-}
-
 void
 fs_generator::enable_debug(const char *shader_name)
 {
@@ -2046,11 +2015,18 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
          break;
 
       case SHADER_OPCODE_UNTYPED_ATOMIC:
-         generate_untyped_atomic(inst, dst, src[0], src[1], src[2]);
+         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, true);
+         brw_mark_surface_used(prog_data, src[2].dw1.ud);
          break;
 
       case SHADER_OPCODE_UNTYPED_SURFACE_READ:
-         generate_untyped_surface_read(inst, dst, src[0], src[1]);
+         assert(src[1].file == BRW_IMMEDIATE_VALUE);
+         brw_untyped_surface_read(p, dst, src[0], src[1],
+                                  inst->mlen, 1);
+         brw_mark_surface_used(prog_data, src[1].dw1.ud);
          break;
 
       case FS_OPCODE_SET_SIMD4X2_OFFSET:
index 327db86ae9b1f2de573b2d55f7f89230b6061dbc..1f1f100788eae7f9594b5f28bd1493ca3a60fd6d 100644 (file)
@@ -504,15 +504,6 @@ private:
                                          struct brw_reg dst);
    void generate_unpack_flags(struct brw_reg dst);
 
-   void generate_untyped_atomic(vec4_instruction *inst,
-                                struct brw_reg dst,
-                                struct brw_reg atomic_op,
-                                struct brw_reg surf_index);
-
-   void generate_untyped_surface_read(vec4_instruction *inst,
-                                      struct brw_reg dst,
-                                      struct brw_reg surf_index);
-
    struct brw_context *brw;
    const struct brw_device_info *devinfo;
 
index b9ab0123b481e1866a9f9a247603e1ac1bfd82f7..de7e06c76173c2f7f6b52271360d2783232d961a 100644 (file)
@@ -1110,38 +1110,6 @@ vec4_generator::generate_set_simd4x2_header_gen9(vec4_instruction *inst,
    brw_pop_insn_state(p);
 }
 
-void
-vec4_generator::generate_untyped_atomic(vec4_instruction *inst,
-                                        struct brw_reg dst,
-                                        struct brw_reg atomic_op,
-                                        struct brw_reg surf_index)
-{
-   assert(atomic_op.file == BRW_IMMEDIATE_VALUE &&
-          atomic_op.type == BRW_REGISTER_TYPE_UD &&
-          surf_index.file == BRW_IMMEDIATE_VALUE &&
-         surf_index.type == BRW_REGISTER_TYPE_UD);
-
-   brw_untyped_atomic(p, dst, brw_message_reg(inst->base_mrf),
-                      surf_index, atomic_op.dw1.ud,
-                      inst->mlen, true);
-
-   brw_mark_surface_used(&prog_data->base, surf_index.dw1.ud);
-}
-
-void
-vec4_generator::generate_untyped_surface_read(vec4_instruction *inst,
-                                              struct brw_reg dst,
-                                              struct brw_reg surf_index)
-{
-   assert(surf_index.file == BRW_IMMEDIATE_VALUE &&
-         surf_index.type == BRW_REGISTER_TYPE_UD);
-
-   brw_untyped_surface_read(p, dst, brw_message_reg(inst->base_mrf),
-                            surf_index, inst->mlen, 1);
-
-   brw_mark_surface_used(&prog_data->base, surf_index.dw1.ud);
-}
-
 void
 vec4_generator::generate_code(const cfg_t *cfg)
 {
@@ -1501,11 +1469,18 @@ vec4_generator::generate_code(const cfg_t *cfg)
          break;
 
       case SHADER_OPCODE_UNTYPED_ATOMIC:
-         generate_untyped_atomic(inst, dst, src[0], src[1]);
+         assert(src[0].file == BRW_IMMEDIATE_VALUE &&
+                src[1].file == BRW_IMMEDIATE_VALUE);
+         brw_untyped_atomic(p, dst, brw_message_reg(inst->base_mrf),
+                            src[1], src[0].dw1.ud, inst->mlen, true);
+         brw_mark_surface_used(&prog_data->base, src[1].dw1.ud);
          break;
 
       case SHADER_OPCODE_UNTYPED_SURFACE_READ:
-         generate_untyped_surface_read(inst, dst, src[0]);
+         assert(src[0].file == BRW_IMMEDIATE_VALUE);
+         brw_untyped_surface_read(p, dst, brw_message_reg(inst->base_mrf),
+                                  src[0], inst->mlen, 1);
+         brw_mark_surface_used(&prog_data->base, src[0].dw1.ud);
          break;
 
       case VS_OPCODE_UNPACK_FLAGS_SIMD4X2: