[Mesa-dev] [PATCH 1/2] i965: Explicitly set base_mrf to -1 for pull constant loads on Gen7

Neil Roberts neil at linux.intel.com
Wed Jun 10 07:02:16 PDT 2015


A freshly constructed instruction defaults to having a base_mrf of 0
which means that if nothing disables it it will default to using
send-from-MRF. Previously this didn't matter because the constant load
instructions on Gen7 were ignoring the base_mrf anyway. However in the
next patch the brw_send_indirect_message function will be taught to
look at base_mrf so if we don't explicitly set it to -1 it will break.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 7789ca7..6ba689b 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -265,6 +265,8 @@ fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_builder &bld,
          inst->mlen = 3;
       else
          inst->mlen = 1 + dispatch_width / 8;
+   } else {
+      inst->base_mrf = -1;
    }
 
    bld.MOV(dst, offset(vec4_result, (const_offset & 3) * scale));
@@ -2980,6 +2982,7 @@ fs_visitor::lower_uniform_pull_constant_loads()
           */
          inst->opcode = FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GEN7;
          inst->src[1] = payload;
+         inst->base_mrf = -1;
 
          invalidate_live_intervals();
       } else {
-- 
1.9.3



More information about the mesa-dev mailing list