i965/fs: Emit fixed width memory fence opcode regardless of the dispatch width.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 26 Apr 2016 00:30:54 +0000 (17:30 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 28 May 2016 06:29:05 +0000 (23:29 -0700)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index b4aeea86f9b1c50000e814d58edef9994cba2edb..5135828a95194b7decbb35f784c731d7cf243bae 100644 (file)
@@ -3428,8 +3428,9 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
    case nir_intrinsic_memory_barrier_buffer:
    case nir_intrinsic_memory_barrier_image:
    case nir_intrinsic_memory_barrier: {
-      const fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD, 16 / dispatch_width);
-      bld.emit(SHADER_OPCODE_MEMORY_FENCE, tmp)
+      const fs_builder ubld = bld.group(8, 0);
+      const fs_reg tmp = ubld.vgrf(BRW_REGISTER_TYPE_UD, 2);
+      ubld.emit(SHADER_OPCODE_MEMORY_FENCE, tmp)
          ->regs_written = 2;
       break;
    }