[Mesa-dev] [PATCH 3/4] ac/surface: sanity-check that we got a TC-compatible HTILE if requested

Nicolai Hähnle nhaehnle at gmail.com
Fri Sep 8 17:16:09 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 src/amd/common/ac_surface.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 4edefc7c40a..0c24116c6ac 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -671,20 +671,26 @@ static int gfx6_compute_surface(ADDR_HANDLE addrlib,
 		for (level = 0; level < config->info.levels; level++) {
 			r = gfx6_compute_level(addrlib, config, surf, false, level, compressed,
 					       &AddrSurfInfoIn, &AddrSurfInfoOut,
 					       &AddrDccIn, &AddrDccOut, &AddrHtileIn, &AddrHtileOut);
 			if (r)
 				return r;
 
 			if (level > 0)
 				continue;
 
+			/* Check that we actually got a TC-compatible HTILE if
+			 * we requested it (only for level 0, since we're not
+			 * supporting HTILE on higher mip levels anyway). */
+			assert(AddrSurfInfoOut.tcCompatible ||
+			       !AddrSurfInfoIn.flags.tcCompatible);
+
 			r = gfx6_surface_settings(addrlib, info, config,
 						  &AddrSurfInfoOut, surf);
 			if (r)
 				return r;
 		}
 	}
 
 	/* Calculate texture layout information for stencil. */
 	if (surf->flags & RADEON_SURF_SBUFFER) {
 		AddrSurfInfoIn.bpp = 8;
-- 
2.11.0



More information about the mesa-dev mailing list