summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-25 14:44:50 -0700
committerJason Ekstrand <[email protected]>2016-08-17 14:46:22 -0700
commit583f040fdab9f9cbd1b5e874cad820296d7a02a4 (patch)
treee8ccb6425c07b22701ea5e8e8036c1105ed5f00c /src/mesa
parent457a40893260f4456433dc5667edbb9094cda130 (diff)
i965/blorp: Refactor fast-clear logic a bit
This pulls the mcs allocation into the if statement where we initially determine that we are doing a fast clear and moves the programming of wm_inputs and figuring out the fast clear rect into it's own if statement. The next commit will put code inbetween the two. Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_clear.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
index df491d1393b..6c527f51633 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -166,22 +166,11 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
params.color_write_disable))
use_simd16_replicated_data = false;
+ bool is_fast_clear = false;
if (irb->mt->fast_clear_state != INTEL_FAST_CLEAR_STATE_NO_MCS &&
!partial_clear && use_simd16_replicated_data &&
brw_is_color_fast_clear_compatible(brw, irb->mt,
&ctx->Color.ClearColor)) {
- memset(&params.wm_inputs, 0xff, 4*sizeof(float));
- params.fast_clear_op = GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE;
-
- brw_get_fast_clear_rect(brw, irb->mt, &params.x0, &params.y0,
- &params.x1, &params.y1);
- }
-
- brw_blorp_params_get_clear_kernel(brw, &params, use_simd16_replicated_data);
-
- const bool is_fast_clear =
- params.fast_clear_op == GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE;
- if (is_fast_clear) {
/* Record the clear color in the miptree so that it will be
* programmed in SURFACE_STATE by later rendering and resolve
* operations.
@@ -208,8 +197,20 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
return false;
}
}
+
+ is_fast_clear = true;
}
+ if (is_fast_clear) {
+ memset(&params.wm_inputs, 0xff, 4*sizeof(float));
+ params.fast_clear_op = GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE;
+
+ brw_get_fast_clear_rect(brw, irb->mt, &params.x0, &params.y0,
+ &params.x1, &params.y1);
+ }
+
+ brw_blorp_params_get_clear_kernel(brw, &params, use_simd16_replicated_data);
+
intel_miptree_check_level_layer(irb->mt, irb->mt_level, layer);
intel_miptree_used_for_rendering(irb->mt);