diff options
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 17 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 786e4e02d15..96be396cdd3 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -3606,6 +3606,21 @@ fs_visitor::optimize() lower_uniform_pull_constant_loads(); } +/** + * Three source instruction must have a GRF/MRF destination register. + * ARF NULL is not allowed. Fix that up by allocating a temporary GRF. + */ +void +fs_visitor::fixup_3src_null_dest() +{ + foreach_block_and_inst_safe (block, fs_inst, inst, cfg) { + if (inst->is_3src() && inst->dst.is_null()) { + inst->dst = fs_reg(GRF, virtual_grf_alloc(dispatch_width / 8), + inst->dst.type); + } + } +} + void fs_visitor::allocate_registers() { @@ -3703,6 +3718,7 @@ fs_visitor::run_vs() assign_curb_setup(); assign_vs_urb_setup(); + fixup_3src_null_dest(); allocate_registers(); return !failed; @@ -3781,6 +3797,7 @@ fs_visitor::run_fs() assign_curb_setup(); assign_urb_setup(); + fixup_3src_null_dest(); allocate_registers(); if (failed) diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 419fe48f1aa..b0eb701888d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -424,6 +424,7 @@ public: void setup_payload_gen4(); void setup_payload_gen6(); void setup_vs_payload(); + void fixup_3src_null_dest(); void assign_curb_setup(); void calculate_urb_setup(); void assign_urb_setup(); |