diff options
author | Matt Turner <[email protected]> | 2014-06-28 18:38:03 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-06-30 22:31:05 -0700 |
commit | 4fe53ee5d7c418d1ed51c5e8dfe5a2b1f48127a3 (patch) | |
tree | ced3ef6bcccda1e55f13c41d728d75173a6e4814 /src/mesa/drivers | |
parent | 6d2536395d45e0c8c21186811b1a63da4cb12198 (diff) |
i965/fs: Predicate PLN instructions used in unlit centroid WA.
Maybe lets us skip some PLN instructions if whole subspans are disabled?
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index d1ded33a6b0..45b75cb2f70 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1168,9 +1168,6 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) /* Smooth/noperspective interpolation case. */ for (unsigned int k = 0; k < type->vector_elements; k++) { struct brw_reg interp = interp_reg(location, k); - emit_linterp(attr, fs_reg(interp), interpolation_mode, - ir->data.centroid && !key->persample_shading, - ir->data.sample || key->persample_shading); if (brw->needs_unlit_centroid_workaround && ir->data.centroid) { /* Get the pixel/sample mask into f0 so that we know * which pixels are lit. Then, for each channel that is @@ -1178,11 +1175,22 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) * data. */ emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS); - fs_inst *inst = emit_linterp(attr, fs_reg(interp), - interpolation_mode, - false, false); + + fs_inst *inst; + inst = emit_linterp(attr, fs_reg(interp), interpolation_mode, + ir->data.centroid && !key->persample_shading, + ir->data.sample || key->persample_shading); + inst->predicate = BRW_PREDICATE_NORMAL; + inst->predicate_inverse = false; + + inst = emit_linterp(attr, fs_reg(interp), interpolation_mode, + false, false); inst->predicate = BRW_PREDICATE_NORMAL; inst->predicate_inverse = true; + } else { + emit_linterp(attr, fs_reg(interp), interpolation_mode, + ir->data.centroid && !key->persample_shading, + ir->data.sample || key->persample_shading); } if (brw->gen < 6 && interpolation_mode == INTERP_QUALIFIER_SMOOTH) { emit(BRW_OPCODE_MUL, attr, attr, this->pixel_w); |