[Mesa-dev] [PATCH 24/31] i965/fs: Set default access mode to Align1 for all instructions in the generator.

Francisco Jerez currojerez at riseup.net
Sat May 21 05:47:59 UTC 2016

Currently the generator code for most opcodes honours the default
access mode (which should typically be Align1 in the scalar back-end),
but generate_code() doesn't set it explicitly which means that the
access mode from a previous instruction could leak into the following
ones if you did something special and weren't careful enough to save
and restore the previous access mode.
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index bfbcfa2..652696d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -1698,6 +1698,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
       dst = brw_reg_from_fs_reg(p, inst, &inst->dst, devinfo->gen);
+      brw_set_default_access_mode(p, BRW_ALIGN_1);
       brw_set_default_predicate_control(p, inst->predicate);
       brw_set_default_predicate_inverse(p, inst->predicate_inverse);
       brw_set_default_flag_reg(p, 0, inst->flag_subreg);

More information about the mesa-dev mailing list