aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-06-19 15:48:15 -0700
committerEric Anholt <[email protected]>2018-06-20 09:30:46 -0700
commita52c357a65a40b70f734cac10ae4079c3935c61d (patch)
tree7bd5cc5235e9322314df4d4be174a6cb7e07e6fb
parent1334295f29cfb9f5e0ee49afae131ce03455c2f2 (diff)
v3d: Add missing reference to the separate stencil buffer.
Noticed while debugging a missing flush of rendering in the z32f_s8 case.
-rw-r--r--src/gallium/drivers/v3d/v3dx_draw.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c
index eb3afaa026d..1cf4d803f68 100644
--- a/src/gallium/drivers/v3d/v3dx_draw.c
+++ b/src/gallium/drivers/v3d/v3dx_draw.c
@@ -563,21 +563,23 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
for (int i = 0; i < v3d->streamout.num_targets; i++)
v3d->streamout.offsets[i] += info->count;
- if (v3d->zsa && job->zsbuf &&
- (v3d->zsa->base.depth.enabled ||
- v3d->zsa->base.stencil[0].enabled)) {
+ if (v3d->zsa && job->zsbuf && v3d->zsa->base.depth.enabled) {
struct v3d_resource *rsc = v3d_resource(job->zsbuf->texture);
v3d_job_add_bo(job, rsc->bo);
- if (v3d->zsa->base.depth.enabled) {
- job->resolve |= PIPE_CLEAR_DEPTH;
- rsc->initialized_buffers = PIPE_CLEAR_DEPTH;
- }
+ job->resolve |= PIPE_CLEAR_DEPTH;
+ rsc->initialized_buffers = PIPE_CLEAR_DEPTH;
+ }
- if (v3d->zsa->base.stencil[0].enabled) {
- job->resolve |= PIPE_CLEAR_STENCIL;
- rsc->initialized_buffers |= PIPE_CLEAR_STENCIL;
- }
+ if (v3d->zsa && job->zsbuf && v3d->zsa->base.stencil[0].enabled) {
+ struct v3d_resource *rsc = v3d_resource(job->zsbuf->texture);
+ if (rsc->separate_stencil)
+ rsc = rsc->separate_stencil;
+
+ v3d_job_add_bo(job, rsc->bo);
+
+ job->resolve |= PIPE_CLEAR_STENCIL;
+ rsc->initialized_buffers |= PIPE_CLEAR_STENCIL;
}
for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {