i965/fs: Remove FS_OPCODE_PACK_STENCIL_REF virtual instruction.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 20 May 2016 07:13:19 +0000 (00:13 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 28 May 2016 06:22:10 +0000 (23:22 -0700)
It's just a byte MOV with strided source.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp

index 91194713ef86f4725950582573ac3c4d1102104a..a5f3b52fa350ce78c5959c3e1a957681a23e327d 100644 (file)
@@ -951,7 +951,6 @@ enum opcode {
    FS_OPCODE_FB_WRITE_LOGICAL,
 
    FS_OPCODE_REP_FB_WRITE,
-   FS_OPCODE_PACK_STENCIL_REF,
    SHADER_OPCODE_RCP,
    SHADER_OPCODE_RSQ,
    SHADER_OPCODE_SQRT,
index 03db084aa8b70ccc42a7672e0a342702c157aeb2..5c5354e34f494024d138db329ecf03e9f0e534ff 100644 (file)
@@ -3824,8 +3824,8 @@ lower_fb_write_logical_send(const fs_builder &bld, fs_inst *inst,
 
       sources[length] = bld.vgrf(BRW_REGISTER_TYPE_UD);
       bld.exec_all().annotate("FB write OS")
-         .emit(FS_OPCODE_PACK_STENCIL_REF, sources[length],
-               retype(src_stencil, BRW_REGISTER_TYPE_UB));
+         .MOV(retype(sources[length], BRW_REGISTER_TYPE_UB),
+              subscript(src_stencil, BRW_REGISTER_TYPE_UB, 0));
       length++;
    }
 
index 5630063ff48b51e84bc7ec9520bd119e16fd7a0b..c249c82576a6c45c5c73afd9d36db52642639ccf 100644 (file)
@@ -430,8 +430,6 @@ private:
    void generate_urb_read(fs_inst *inst, struct brw_reg dst, struct brw_reg payload);
    void generate_urb_write(fs_inst *inst, struct brw_reg payload);
    void generate_cs_terminate(fs_inst *inst, struct brw_reg payload);
-   void generate_stencil_ref_packing(fs_inst *inst, struct brw_reg dst,
-                                     struct brw_reg src);
    void generate_barrier(fs_inst *inst, struct brw_reg src);
    void generate_linterp(fs_inst *inst, struct brw_reg dst,
                         struct brw_reg *src);
index 6919a9c023fd8e74e6a5583fb9707a32f3d447a0..78a45b6d919efc7bbd7face057bd5d2f1a042ceb 100644 (file)
@@ -509,47 +509,6 @@ fs_generator::generate_cs_terminate(fs_inst *inst, struct brw_reg payload)
    brw_inst_set_mask_control(devinfo, insn, BRW_MASK_DISABLE);
 }
 
-void
-fs_generator::generate_stencil_ref_packing(fs_inst *inst,
-                                           struct brw_reg dst,
-                                           struct brw_reg src)
-{
-   assert(dispatch_width == 8);
-   assert(devinfo->gen >= 9);
-
-   /* Stencil value updates are provided in 8 slots of 1 byte per slot.
-    * Presumably, in order to save memory bandwidth, the stencil reference
-    * values written from the FS need to be packed into 2 dwords (this makes
-    * sense because the stencil values are limited to 1 byte each and a SIMD8
-    * send, so stencil slots 0-3 in dw0, and 4-7 in dw1.)
-    *
-    * The spec is confusing here because in the payload definition of MDP_RTW_S8
-    * (Message Data Payload for Render Target Writes with Stencil 8b) the
-    * stencil value seems to be dw4.0-dw4.7. However, if you look at the type of
-    * dw4 it is type MDPR_STENCIL (Message Data Payload Register) which is the
-    * packed values specified above and diagrammed below:
-    *
-    *     31                             0
-    *     --------------------------------
-    * DW  |                              |
-    * 2-7 |            IGNORED           |
-    *     |                              |
-    *     --------------------------------
-    * DW1 | STC   | STC   | STC   | STC  |
-    *     | slot7 | slot6 | slot5 | slot4|
-    *     --------------------------------
-    * DW0 | STC   | STC   | STC   | STC  |
-    *     | slot3 | slot2 | slot1 | slot0|
-    *     --------------------------------
-    */
-
-   src.vstride = BRW_VERTICAL_STRIDE_4;
-   src.width = BRW_WIDTH_1;
-   src.hstride = BRW_HORIZONTAL_STRIDE_0;
-   assert(src.type == BRW_REGISTER_TYPE_UB);
-   brw_MOV(p, retype(dst, BRW_REGISTER_TYPE_UB), src);
-}
-
 void
 fs_generator::generate_barrier(fs_inst *inst, struct brw_reg src)
 {
@@ -2102,10 +2061,6 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
         generate_barrier(inst, src[0]);
         break;
 
-      case FS_OPCODE_PACK_STENCIL_REF:
-         generate_stencil_ref_packing(inst, dst, src[0]);
-         break;
-
       default:
          unreachable("Unsupported opcode");
 
index a9051a89aa6590c10c947a561189a6bda0d08588..bdaf513a548c5d1d398dc69c67413b500ee32965 100644 (file)
@@ -163,8 +163,6 @@ brw_instruction_name(const struct brw_device_info *devinfo, enum opcode op)
       return "fb_write";
    case FS_OPCODE_FB_WRITE_LOGICAL:
       return "fb_write_logical";
-   case FS_OPCODE_PACK_STENCIL_REF:
-      return "pack_stencil_ref";
    case FS_OPCODE_REP_FB_WRITE:
       return "rep_fb_write";