OSDN Git Service

i965/fs: Mark UBO uniform pull constant loads as force_writemask_all.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 23 May 2016 21:07:23 +0000 (14:07 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 23 May 2016 21:07:23 +0000 (14:07 -0700)
This lets the rest of the backend know that the uniform pull constant
load opcodes don't respect channel enables -- Without this the
register allocator has no way to know that the return payload of a
pull constant load is not per-channel and spills of the destination
will be broken under non-uniform control flow.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 2a48651..0a847f8 100644 (file)
@@ -2176,10 +2176,12 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
         break;
 
       case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD:
+         assert(inst->force_writemask_all);
         generate_uniform_pull_constant_load(inst, dst, src[0], src[1]);
         break;
 
       case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GEN7:
+         assert(inst->force_writemask_all);
         generate_uniform_pull_constant_load_gen7(inst, dst, src[0], src[1]);
         break;
 
index b7df286..cc30838 100644 (file)
@@ -3611,7 +3611,8 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
             const unsigned count = MIN2(instr->num_components - c,
                                         (16 - base % 16) / type_size);
 
-            bld.emit(FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD,
+            bld.exec_all()
+               .emit(FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD,
                      packed_consts, surf_index, brw_imm_ud(base & ~15));
 
             const fs_reg consts =