summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2018-11-13 13:40:58 -0500
committerRob Clark <robdclark@gmail.com>2018-11-27 15:44:02 -0500
commit65cee01430d03b140c1a916e9409f045e24d4b8f (patch)
treede8d7b738d0f5c9bf0c2e74e5238d6af9b620c9d
parentaa0fed10d3574aec8c129bace78018ae060484c0 (diff)
mesa/st: swap order of clear() and clear_with_quad()
If we can't clear all the buffers with pctx->clear() (say, for example, because of ColorMask), push the buffers we *can* clear with pctx->clear() first. Tilers want to see clears coming before draws to enable fast- paths, and clearing one of the attachments with a quad-draw first confuses that logic. Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 22e85019764..3b51bd2c8a7 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -442,9 +442,6 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
* use pipe->clear. We want to always use pipe->clear for the other
* renderbuffers, because it's likely to be faster.
*/
- if (quad_buffers) {
- clear_with_quad(ctx, quad_buffers);
- }
if (clear_buffers) {
/* We can't translate the clear color to the colorbuffer format,
* because different colorbuffers may have different formats.
@@ -453,6 +450,9 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
(union pipe_color_union*)&ctx->Color.ClearColor,
ctx->Depth.Clear, ctx->Stencil.Clear);
}
+ if (quad_buffers) {
+ clear_with_quad(ctx, quad_buffers);
+ }
if (mask & BUFFER_BIT_ACCUM)
_mesa_clear_accum_buffer(ctx);
}