intel/fs: Move the scalar-region conversion to the generator.
authorRafael Antognolli <rafael.antognolli@intel.com>
Fri, 19 Oct 2018 22:44:15 +0000 (15:44 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Mon, 22 Apr 2019 23:54:00 +0000 (16:54 -0700)
Move the scalar-region conversion from the IR to the generator, so it
doesn't affect the Gen11 path. We need the non-scalar regioning
for a later lowering pass that we are adding.

v2: Better commit message (Matt)

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs_generator.cpp
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_fs_visitor.cpp

index e5ec2cbc450a6ee798aa6c3e9535254fa76dab40..8d72eb8837df5a5321fefa378ccf689b58c742fe 100644 (file)
@@ -1211,7 +1211,7 @@ fs_visitor::emit_fragcoord_interpolation(fs_reg wpos)
    } else {
       bld.emit(FS_OPCODE_LINTERP, wpos,
                this->delta_xy[BRW_BARYCENTRIC_PERSPECTIVE_PIXEL],
-               component(interp_reg(VARYING_SLOT_POS, 2), 0));
+               interp_reg(VARYING_SLOT_POS, 2));
    }
    wpos = offset(wpos, bld, 1);
 
index 05283f54112e3645fbd29bda037a81ae2ee2bbb1..d6a0f2368b80127c2e978aade249b27a81cf2bc5 100644 (file)
@@ -818,7 +818,7 @@ fs_generator::generate_linterp(fs_inst *inst,
     */
    struct brw_reg delta_x = src[0];
    struct brw_reg delta_y = offset(src[0], inst->exec_size / 8);
-   struct brw_reg interp = src[1];
+   struct brw_reg interp = stride(src[1], 0, 1, 0);
    brw_inst *i[4];
 
    if (devinfo->gen >= 11) {
index c306d5ca2baec03a6862d1a7d0b44ff20db4de10..59d9926606b21b5d3e8eac03186c3546806902df 100644 (file)
@@ -3612,8 +3612,8 @@ fs_visitor::nir_emit_fs_intrinsic(const fs_builder &bld,
 
       for (unsigned int i = 0; i < instr->num_components; i++) {
          fs_reg interp =
-            component(interp_reg(nir_intrinsic_base(instr),
-                                 nir_intrinsic_component(instr) + i), 0);
+            interp_reg(nir_intrinsic_base(instr),
+                       nir_intrinsic_component(instr) + i);
          interp.type = BRW_REGISTER_TYPE_F;
          dest.type = BRW_REGISTER_TYPE_F;
 
index 232693cec78325fe1c44c130164dd023931b0ce7..af9f803fb683161f3ef11610648a4700d75c9817 100644 (file)
@@ -194,7 +194,7 @@ fs_visitor::emit_interpolation_setup_gen4()
     */
    this->wpos_w = vgrf(glsl_type::float_type);
    abld.emit(FS_OPCODE_LINTERP, wpos_w, delta_xy,
-             component(interp_reg(VARYING_SLOT_POS, 3), 0));
+             interp_reg(VARYING_SLOT_POS, 3));
    /* Compute the pixel 1/W value from wpos.w. */
    this->pixel_w = vgrf(glsl_type::float_type);
    abld.emit(SHADER_OPCODE_RCP, this->pixel_w, wpos_w);