dzn: Force sampleCounts to 1 for bgra4 images
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 31 Mar 2022 16:04:24 +0000 (18:04 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 8 Apr 2022 11:54:43 +0000 (11:54 +0000)
Those are not expected to be used as render-target, and Vulkan mandates
that such formats get their sampleCounts set to VK_SAMPLE_COUNT_1_BIT.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

src/microsoft/vulkan/dzn_device.cpp

index 03c4195..215707f 100644 (file)
@@ -789,7 +789,7 @@ dzn_physical_device_get_image_format_properties(dzn_physical_device *pdev,
    if (info->tiling != VK_IMAGE_TILING_LINEAR &&
        info->type == VK_IMAGE_TYPE_2D &&
        !(info->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) &&
-       rt_or_ds_cap &&
+       rt_or_ds_cap && !is_bgra4 &&
        !(info->usage & VK_IMAGE_USAGE_STORAGE_BIT)) {
       for (uint32_t s = VK_SAMPLE_COUNT_2_BIT; s < VK_SAMPLE_COUNT_64_BIT; s <<= 1) {
          D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS ms_info = {