[Mesa-dev] [PATCH] radv: fix fmask surface creation (on top of nha rework)

Dave Airlie airlied at gmail.com
Sun May 14 23:43:25 UTC 2017


From: Dave Airlie <airlied at redhat.com>

The old code copied over all the surface info from the image
surface, we only want some bits of it, and to modify the flags.

This fixes a regression caused by nha's rework of surface,
and should probably be squashed in somewhere.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_image.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index c254228..b57162c 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -459,21 +459,14 @@ radv_image_get_fmask_info(struct radv_device *device,
 			  struct radv_fmask_info *out)
 {
 	/* FMASK is allocated like an ordinary texture. */
-	struct radeon_surf fmask = image->surface;
+	struct radeon_surf fmask = {};
 	struct ac_surf_info info = image->info;
 	memset(out, 0, sizeof(*out));
 
-	fmask.surf_alignment = 0;
-	fmask.surf_size = 0;
-	fmask.flags |= RADEON_SURF_FMASK;
+	fmask.blk_w = image->surface.blk_w;
+	fmask.blk_h = image->surface.blk_h;
 	info.samples = 1;
-	/* Force 2D tiling if it wasn't set. This may occur when creating
-	 * FMASK for MSAA resolve on R6xx. On R6xx, the single-sample
-	 * destination buffer must have an FMASK too. */
-	fmask.flags = RADEON_SURF_CLR(fmask.flags, MODE);
-	fmask.flags |= RADEON_SURF_SET(RADEON_SURF_MODE_2D, MODE);
-
-	fmask.flags |= RADEON_SURF_HAS_TILE_MODE_INDEX;
+	fmask.flags = image->surface.flags | RADEON_SURF_FMASK;
 
 	switch (nr_samples) {
 	case 2:
-- 
2.9.3



More information about the mesa-dev mailing list