[Mesa-dev] [PATCH 04/20] gallium/radeon: also eliminate DCC fast clear in resource_get_handle

Marek Olšák maraeo at gmail.com
Mon Aug 29 15:28:19 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

just do what the comment says
---
 src/gallium/drivers/radeon/r600_texture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 912d123..7bdceb1 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -541,28 +541,29 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
 		/* Since shader image stores don't support DCC on VI,
 		 * disable it for external clients that want write
 		 * access.
 		 */
 		if (usage & PIPE_HANDLE_USAGE_WRITE && rtex->dcc_offset) {
 			if (r600_texture_disable_dcc(rctx, rtex))
 				update_metadata = true;
 		}
 
 		if (!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) &&
-		    rtex->cmask.size) {
+		    (rtex->cmask.size || rtex->dcc_offset)) {
 			/* Eliminate fast clear (both CMASK and DCC) */
 			r600_eliminate_fast_color_clear(rctx, rtex);
 
 			/* Disable CMASK if flush_resource isn't going
 			 * to be called.
 			 */
-			r600_texture_discard_cmask(rscreen, rtex);
+			if (rtex->cmask.size)
+				r600_texture_discard_cmask(rscreen, rtex);
 		}
 
 		/* Set metadata. */
 		if (!res->is_shared || update_metadata) {
 			r600_texture_init_metadata(rtex, &metadata);
 			if (rscreen->query_opaque_metadata)
 				rscreen->query_opaque_metadata(rscreen, rtex,
 							       &metadata);
 
 			rscreen->ws->buffer_set_metadata(res->buf, &metadata);
-- 
2.7.4



More information about the mesa-dev mailing list