summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_image.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-10-12 22:55:32 +0200
committerSamuel Pitoiset <[email protected]>2017-10-14 12:25:48 +0200
commit0c1aecf177bbabff16aaef301483f689e8b850bb (patch)
tree79e2daf7f53c5eb5713363b612376f5455c91c56 /src/amd/vulkan/radv_image.c
parenta4c08c8cd5257fd628ab829bec0a119076c8f641 (diff)
radv: do not allocate CMASK for non-MSSA images with 128 bit formats
This saves some useless CMASK initializations/eliminations in the Vulkan SSAO demo. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_image.c')
-rw-r--r--src/amd/vulkan/radv_image.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 7c3e55b1b85..0564454c776 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -819,6 +819,14 @@ radv_image_can_enable_dcc(struct radv_image *image)
static inline bool
radv_image_can_enable_cmask(struct radv_image *image)
{
+ if (image->surface.bpe > 8 && image->info.samples == 1) {
+ /* Do not enable CMASK for non-MSAA images (fast color clear)
+ * because 128 bit formats are not supported, but FMASK might
+ * still be used.
+ */
+ return false;
+ }
+
return radv_image_can_enable_dcc_or_cmask(image) &&
image->info.levels == 1 &&
image->info.depth == 1 &&