diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-23 05:33:34 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-23 05:33:34 +0000 |
commit | 9886815a25d84be79f51e65ebd8e458bb5d26ca8 (patch) | |
tree | a65edf018dd992543337433f7303fb29a6c8e8cf /lib/mesa/src/gallium/drivers/freedreno/freedreno_draw.c | |
parent | e2a3acb64af2657b1181806818eacad061103c23 (diff) |
Merge Mesa 19.0.5
Diffstat (limited to 'lib/mesa/src/gallium/drivers/freedreno/freedreno_draw.c')
-rw-r--r-- | lib/mesa/src/gallium/drivers/freedreno/freedreno_draw.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/mesa/src/gallium/drivers/freedreno/freedreno_draw.c b/lib/mesa/src/gallium/drivers/freedreno/freedreno_draw.c index 90d0e4403..670388681 100644 --- a/lib/mesa/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/lib/mesa/src/gallium/drivers/freedreno/freedreno_draw.c @@ -144,9 +144,13 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) } else { batch->invalidated |= FD_BUFFER_DEPTH; } - buffers |= FD_BUFFER_DEPTH; - resource_written(batch, pfb->zsbuf->texture); batch->gmem_reason |= FD_GMEM_DEPTH_ENABLED; + if (fd_depth_write_enabled(ctx)) { + buffers |= FD_BUFFER_DEPTH; + resource_written(batch, pfb->zsbuf->texture); + } else { + resource_read(batch, pfb->zsbuf->texture); + } } if (fd_stencil_enabled(ctx)) { @@ -155,18 +159,9 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) } else { batch->invalidated |= FD_BUFFER_STENCIL; } + batch->gmem_reason |= FD_GMEM_STENCIL_ENABLED; buffers |= FD_BUFFER_STENCIL; resource_written(batch, pfb->zsbuf->texture); - batch->gmem_reason |= FD_GMEM_STENCIL_ENABLED; - } - } - - if (ctx->dirty & FD_DIRTY_FRAMEBUFFER) { - for (i = 0; i < pfb->nr_cbufs; i++) { - if (!pfb->cbufs[i]) - continue; - - resource_written(batch, pfb->cbufs[i]->texture); } } @@ -191,6 +186,9 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) if (fd_blend_enabled(ctx, i)) batch->gmem_reason |= FD_GMEM_BLEND_ENABLED; + + if (ctx->dirty & FD_DIRTY_FRAMEBUFFER) + resource_written(batch, pfb->cbufs[i]->texture); } /* Mark SSBOs as being written.. we don't actually know which ones are @@ -291,6 +289,8 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) if (ctx->draw_vbo(ctx, info, index_offset)) batch->needs_flush = true; + batch->num_vertices += info->count * info->instance_count; + for (i = 0; i < ctx->streamout.num_targets; i++) ctx->streamout.offsets[i] += info->count; @@ -410,7 +410,7 @@ fd_clear(struct pipe_context *pctx, unsigned buffers, * the depth buffer, etc) */ cleared_buffers = buffers & (FD_BUFFER_ALL & ~batch->restore); - batch->cleared |= cleared_buffers; + batch->cleared |= buffers; batch->invalidated |= cleared_buffers; batch->resolve |= buffers; |