Mesa (master): radv: Use ac_surface to determine fmask enable.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 5 13:43:29 UTC 2020
Module: Mesa
Branch: master
Commit: 599ea341dd17cef54b5e083279cb5ec4748c7f9a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=599ea341dd17cef54b5e083279cb5ec4748c7f9a
Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date: Sun May 24 11:57:09 2020 +0200
radv: Use ac_surface to determine fmask enable.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5194>
---
src/amd/vulkan/radv_image.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index e28523ddb70..3f9395774bd 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -230,6 +230,13 @@ radv_use_dcc_for_image(struct radv_device *device,
return true;
}
+static inline bool
+radv_use_fmask_for_image(const struct radv_image *image)
+{
+ return image->info.samples > 1 &&
+ image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+}
+
static bool
radv_use_tc_compat_cmask_for_image(struct radv_device *device,
struct radv_image *image)
@@ -458,6 +465,9 @@ radv_init_surface(struct radv_device *device,
if (!radv_use_dcc_for_image(device, image, pCreateInfo, image_format))
surface->flags |= RADEON_SURF_DISABLE_DCC;
+ if (!radv_use_fmask_for_image(image))
+ surface->flags |= RADEON_SURF_NO_FMASK;
+
return 0;
}
@@ -1313,13 +1323,6 @@ radv_image_can_enable_cmask(struct radv_image *image)
!image->planes[0].surface.is_linear;
}
-static inline bool
-radv_image_can_enable_fmask(struct radv_image *image)
-{
- return image->info.samples > 1 &&
- image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
-}
-
static inline bool
radv_image_can_enable_htile(struct radv_image *image)
{
@@ -1400,7 +1403,7 @@ radv_image_create_layout(struct radv_device *device,
}
/* Try to enable FMASK for multisampled images. */
- if (radv_image_can_enable_fmask(image)) {
+ if (image->planes[0].surface.fmask_size) {
radv_image_alloc_fmask(device, image);
if (radv_use_tc_compat_cmask_for_image(device, image))
More information about the mesa-commit
mailing list