summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_draw.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-04-22 14:35:00 -0400
committerIlia Mirkin <[email protected]>2015-04-27 20:17:07 -0400
commit9fc3f472784b2ba53655b715d602268bef5bf12e (patch)
treee688bbd65a3c15c3f767ad4e94dad70e54a36ac5 /src/gallium/drivers/freedreno/freedreno_draw.c
parent1571da6ac31ade482f5e4adc82eb66d42a1bb389 (diff)
freedreno/a3xx: add support for S8 and Z32F_S8
Enables ARB_depth_buffer_float. There is no sampling support for interleaved Z32F_S8, so we store the two textures separately, one as Z32F, the other as S8. As a result, we need a lot of additional logic for restores and transfers. Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_draw.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_draw.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index fed3e64f202..c9e317c7dc9 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -88,8 +88,12 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
}
if (fd_stencil_enabled(ctx)) {
+ struct fd_resource *rsc = fd_resource(pfb->zsbuf->texture);
buffers |= FD_BUFFER_STENCIL;
- fd_resource(pfb->zsbuf->texture)->dirty = true;
+ if (rsc->stencil)
+ rsc->stencil->dirty = true;
+ else
+ rsc->dirty = true;
ctx->gmem_reason |= FD_GMEM_STENCIL_ENABLED;
}
@@ -215,7 +219,12 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
fd_resource(pfb->cbufs[i]->texture)->dirty = true;
if (buffers & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) {
- fd_resource(pfb->zsbuf->texture)->dirty = true;
+ struct fd_resource *rsc = fd_resource(pfb->zsbuf->texture);
+ if (rsc->stencil && buffers & PIPE_CLEAR_STENCIL)
+ rsc->stencil->dirty = true;
+ if (!rsc->stencil || buffers & PIPE_CLEAR_DEPTH)
+ rsc->dirty = true;
+
ctx->gmem_reason |= FD_GMEM_CLEARS_DEPTH_STENCIL;
}