diff options
Diffstat (limited to 'src/gallium/drivers/r600/r600_hw_context.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index d985af9879f..9c0a78e0720 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -644,11 +644,15 @@ void r600_flag_resource_cache_flush(struct r600_context *rctx, /* Check colorbuffers. */ for (i = 0; i < rctx->framebuffer.state.nr_cbufs; i++) { - if (rctx->framebuffer.state.cbufs[i] && - rctx->framebuffer.state.cbufs[i]->texture == res) { - struct r600_texture *tex = - (struct r600_texture*)rctx->framebuffer.state.cbufs[i]->texture; + struct r600_texture *tex; + if (rctx->framebuffer.state.cbufs[i] == NULL) { + continue; + } + + tex = (struct r600_texture*)rctx->framebuffer.state.cbufs[i]->texture; + + if (rctx->framebuffer.state.cbufs[i]->texture == res) { rctx->b.flags |= R600_CONTEXT_FLUSH_AND_INV_CB | R600_CONTEXT_FLUSH_AND_INV | R600_CONTEXT_WAIT_3D_IDLE; @@ -658,6 +662,12 @@ void r600_flag_resource_cache_flush(struct r600_context *rctx, } break; } + + if (tex && tex->cmask && tex->cmask != &tex->resource && &tex->cmask->b.b == res) { + rctx->b.flags |= R600_CONTEXT_FLUSH_AND_INV_CB_META | + R600_CONTEXT_FLUSH_AND_INV | + R600_CONTEXT_WAIT_3D_IDLE; + } } /* Check a depth buffer. */ |