Mesa (master): radeonsi: check nr_cbufs in other places before flushing CB
Marek Olšák
mareko at kemper.freedesktop.org
Tue Jun 27 17:02:18 UTC 2017
Module: Mesa
Branch: master
Commit: aef998fe4b7551faf8a44409aa74554b45d2b67c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=aef998fe4b7551faf8a44409aa74554b45d2b67c
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue Jun 27 00:32:47 2017 +0200
radeonsi: check nr_cbufs in other places before flushing CB
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/gallium/drivers/radeonsi/si_state.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index b236bed306..a674a602e3 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3975,7 +3975,8 @@ static void si_texture_barrier(struct pipe_context *ctx, unsigned flags)
struct si_context *sctx = (struct si_context *)ctx;
/* Multisample surfaces are flushed in si_decompress_textures. */
- if (sctx->framebuffer.nr_samples <= 1) {
+ if (sctx->framebuffer.nr_samples <= 1 &&
+ sctx->framebuffer.state.nr_cbufs) {
sctx->b.flags |= SI_CONTEXT_INV_VMEM_L1 |
SI_CONTEXT_INV_GLOBAL_L2 |
SI_CONTEXT_FLUSH_AND_INV_CB;
@@ -4021,7 +4022,8 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags)
* si_decompress_textures when needed.
*/
if (flags & PIPE_BARRIER_FRAMEBUFFER &&
- sctx->framebuffer.nr_samples <= 1) {
+ sctx->framebuffer.nr_samples <= 1 &&
+ sctx->framebuffer.state.nr_cbufs) {
sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_CB |
SI_CONTEXT_WRITEBACK_GLOBAL_L2;
}
More information about the mesa-commit
mailing list