diff options
author | Jonathan Marek <[email protected]> | 2019-01-21 11:04:47 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-01-29 20:22:33 +0000 |
commit | c93d77431f711a39a638c43541635cd95924bc2d (patch) | |
tree | e1a81b1000a607275df202277f18c4bf8f72b1a6 /src | |
parent | bcefa0f1cb99229b6dc241ff50b2c88da1dad950 (diff) |
freedreno: fix depth usage logic
Depth can be used even when there is no restore/resolve of depth. This
happens when the depth buffer is invalidated after rendering to avoid
the resolve operation.
Signed-off-by: Jonathan Marek <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_gmem.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index dd35dfa29fa..be82a1eed87 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -122,8 +122,8 @@ calculate_tiles(struct fd_batch *batch) uint8_t cbuf_cpp[MAX_RENDER_TARGETS] = {0}, zsbuf_cpp[2] = {0}; uint32_t i, j, t, xoff, yoff; uint32_t tpp_x, tpp_y; - bool has_zs = !!((batch->resolve | batch->restore) & - (FD_BUFFER_DEPTH | FD_BUFFER_STENCIL)); + bool has_zs = !!(batch->gmem_reason & (FD_GMEM_DEPTH_ENABLED | + FD_GMEM_STENCIL_ENABLED | FD_GMEM_CLEARS_DEPTH_STENCIL)); int tile_n[npipes]; if (has_zs) { @@ -131,6 +131,10 @@ calculate_tiles(struct fd_batch *batch) zsbuf_cpp[0] = rsc->cpp; if (rsc->stencil) zsbuf_cpp[1] = rsc->stencil->cpp; + } else { + /* we might have a zsbuf, but it isn't used */ + batch->restore &= ~(FD_BUFFER_DEPTH | FD_BUFFER_STENCIL); + batch->resolve &= ~(FD_BUFFER_DEPTH | FD_BUFFER_STENCIL); } for (i = 0; i < pfb->nr_cbufs; i++) { if (pfb->cbufs[i]) |