aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-07-21 12:46:04 -0700
committerFrancisco Jerez <[email protected]>2016-08-25 18:36:00 -0700
commit4a87e4ade778e56d43333c65a58752b15a00ce69 (patch)
tree3202c1deb3e304353bf56f1b875e192e6c22f617 /src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
parentaee3d8f0d940a87dba7eae86c9462a3cb3a7d702 (diff)
i965/fs: Get rid of fs_visitor::do_dual_src.
This boolean flag was being used for two different things: - To set the brw_wm_prog_data::dual_src_blend flag. Instead we can just set it based on whether the dual_src_output register is valid, which will be the case if the shader writes the secondary blending color. - To decide whether to call emit_single_fb_write() once, or in a loop that would iterate only once, which seems pretty useless. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_visitor.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp37
1 files changed, 14 insertions, 23 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 4e0db06ca62..cfb5bb65e26 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -469,33 +469,25 @@ fs_visitor::emit_fb_writes()
"in SIMD16+ mode.\n");
}
- if (do_dual_src) {
- const fs_builder abld = bld.annotate("FB dual-source write");
+ for (int target = 0; target < key->nr_color_regions; target++) {
+ /* Skip over outputs that weren't written. */
+ if (this->outputs[target].file == BAD_FILE)
+ continue;
- inst = emit_single_fb_write(abld, this->outputs[0],
- this->dual_src_output, reg_undef, 4);
- inst->target = 0;
-
- prog_data->dual_src_blend = true;
- } else {
- for (int target = 0; target < key->nr_color_regions; target++) {
- /* Skip over outputs that weren't written. */
- if (this->outputs[target].file == BAD_FILE)
- continue;
+ const fs_builder abld = bld.annotate(
+ ralloc_asprintf(this->mem_ctx, "FB write target %d", target));
- const fs_builder abld = bld.annotate(
- ralloc_asprintf(this->mem_ctx, "FB write target %d", target));
+ fs_reg src0_alpha;
+ if (devinfo->gen >= 6 && key->replicate_alpha && target != 0)
+ src0_alpha = offset(outputs[0], bld, 3);
- fs_reg src0_alpha;
- if (devinfo->gen >= 6 && key->replicate_alpha && target != 0)
- src0_alpha = offset(outputs[0], bld, 3);
-
- inst = emit_single_fb_write(abld, this->outputs[target], reg_undef,
- src0_alpha, 4);
- inst->target = target;
- }
+ inst = emit_single_fb_write(abld, this->outputs[target],
+ this->dual_src_output, src0_alpha, 4);
+ inst->target = target;
}
+ prog_data->dual_src_blend = (this->dual_src_output.file != BAD_FILE);
+
if (inst == NULL) {
/* Even if there's no color buffers enabled, we still need to send
* alpha out the pipeline to our null renderbuffer to support
@@ -946,7 +938,6 @@ fs_visitor::init()
this->promoted_constants = 0,
this->spilled_any_registers = false;
- this->do_dual_src = false;
}
fs_visitor::~fs_visitor()