From 8c5b4b1e1dbf73317bbcb4e778bbd900995d6a89 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Sat, 8 Aug 2020 18:42:22 -0500 Subject: [PATCH] anv/image: Minor refactor of VkImageFormatProperties::sampleCounts The code in anv_get_image_format_properties() that set sampleCounts appears correct, but weirdly inconsistent. Clean the code to consistently set sampleCounts in the same location as maxExtent/maxMipLevels/maxArraySize. Acked-by: Lionel Landwerlin Reviewed-by: Jason Ekstrand --- src/intel/vulkan/anv_formats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index f0a0d6a72bb..6cfa41610ad 100644 --- a/src/intel/vulkan/anv_formats.c +++ b/src/intel/vulkan/anv_formats.c @@ -904,7 +904,7 @@ anv_get_image_format_properties( VkExtent3D maxExtent; uint32_t maxMipLevels; uint32_t maxArraySize; - VkSampleCountFlags sampleCounts = VK_SAMPLE_COUNT_1_BIT; + VkSampleCountFlags sampleCounts; const struct gen_device_info *devinfo = &physical_device->info; const struct anv_format *format = anv_get_format(info->format); const struct isl_drm_modifier_info *isl_mod_info = NULL; @@ -946,6 +946,7 @@ anv_get_image_format_properties( maxExtent.depth = 1; maxMipLevels = 15; /* log2(maxWidth) + 1 */ maxArraySize = 2048; + sampleCounts = VK_SAMPLE_COUNT_1_BIT; break; case VK_IMAGE_TYPE_3D: maxExtent.width = 2048; @@ -953,6 +954,7 @@ anv_get_image_format_properties( maxExtent.depth = 2048; maxMipLevels = 12; /* log2(maxWidth) + 1 */ maxArraySize = 1; + sampleCounts = VK_SAMPLE_COUNT_1_BIT; break; } @@ -1060,7 +1062,7 @@ anv_get_image_format_properties( goto unsupported; maxArraySize = 1; maxMipLevels = 1; - assert(sampleCounts == VK_SAMPLE_COUNT_1_BIT); + sampleCounts = VK_SAMPLE_COUNT_1_BIT; /* Modifiers are not yet supported for YCbCr */ const struct anv_format *format = anv_get_format(info->format);