i965/vec4: Use the correct offset for the swizzle shift in push constants
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 19 Apr 2016 01:52:36 +0000 (18:52 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 20 Apr 2016 16:15:01 +0000 (09:15 -0700)
This was actually caught by Ken in review the first time around but somehow
didn't get fixed before the patches were pushed. :-(

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94998
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95001

src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index b5c23c995881ee4f914ed34fc40e6c9fca4f66fe..aa3965a6c3a9ce3ebe970b70db0983c9d3a4460c 100644 (file)
@@ -712,7 +712,7 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
 
          unsigned offset = const_offset->u32[0] + shift * 4;
          src.reg_offset = offset / 16;
-         shift = (nir_intrinsic_base(instr) % 16) / 4;
+         shift = (offset % 16) / 4;
          src.swizzle += BRW_SWIZZLE4(shift, shift, shift, shift);
 
          emit(MOV(dest, src));