diff options
author | Marek Olšák <marek.olsak@amd.com> | 2013-12-06 18:58:52 +0100 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2014-01-13 15:25:31 +0100 |
commit | 9ea3f88c0acc547bbff39d489abda99bc71f376f (patch) | |
tree | 735b929d5ba378d2580623f7f155c3c48ae0fffd | |
parent | c156d245258842c41d1ffac06a08ee7eeb45b33f (diff) |
st/mesa: always prefer pipe->clear over clear_with_quad (v2)
v2: clear depth and stencil together
-rw-r--r-- | src/mesa/state_tracker/st_cb_clear.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 887e58bd9b6..363f2f74699 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -476,14 +476,23 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) } } - /* - * If we're going to use clear_with_quad() for any reason, use it for - * everything possible. + /* Always clear depth and stencil together. + * This can only happen when the stencil writemask is not a full mask. + */ + if (quad_buffers & PIPE_CLEAR_DEPTHSTENCIL && + clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) { + quad_buffers |= clear_buffers & PIPE_CLEAR_DEPTHSTENCIL; + clear_buffers &= ~PIPE_CLEAR_DEPTHSTENCIL; + } + + /* Only use quad-based clearing for the renderbuffers which cannot + * use pipe->clear. We want to always use pipe->clear for the other + * renderbuffers, because it's likely to be faster. */ if (quad_buffers) { - quad_buffers |= clear_buffers; clear_with_quad(ctx, quad_buffers); - } else if (clear_buffers) { + } + if (clear_buffers) { /* We can't translate the clear color to the colorbuffer format, * because different colorbuffers may have different formats. */ |