diff options
author | Eric Anholt <[email protected]> | 2018-07-23 14:08:54 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-07-26 11:02:25 -0700 |
commit | deecc1ef86239f4aa9f7a28e2068245f4cd6f8eb (patch) | |
tree | 1725c90e06ff4eb150d9f306e8f9b76bf34c6528 /src | |
parent | 301c32caf4c656731006409720d521f4709e60ac (diff) |
v3d: Avoid the GFXH-1461 workaround if we have only Z or only S.
This seems like a sensible precaution to avoid extra draws. It doesn't
deal with the case of a Z24S8 buffer created by the window system for an
application that happens to never use S.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/v3d/v3dx_draw.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 6aa58ceaafe..13143191d21 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -671,9 +671,11 @@ v3d_tlb_clear(struct v3d_job *job, unsigned buffers, * if it would be possible to need to emit a load of just one after * we've set up our TLB clears. */ - unsigned zsclear = buffers & PIPE_CLEAR_DEPTHSTENCIL; - if (zsclear && zsclear != PIPE_CLEAR_DEPTHSTENCIL) { - buffers &= ~zsclear; + if (buffers & PIPE_CLEAR_DEPTHSTENCIL && + (buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL && + job->zsbuf && + util_format_is_depth_and_stencil(job->zsbuf->texture->format)) { + buffers &= ~PIPE_CLEAR_DEPTHSTENCIL; } for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) { @@ -732,7 +734,7 @@ v3d_tlb_clear(struct v3d_job *job, unsigned buffers, rsc->initialized_buffers |= bit; } - zsclear = buffers & PIPE_CLEAR_DEPTHSTENCIL; + unsigned zsclear = buffers & PIPE_CLEAR_DEPTHSTENCIL; if (zsclear) { struct v3d_resource *rsc = v3d_resource(v3d->framebuffer.zsbuf->texture); |