turnip: disable UBWC on Z24_S8 MSAA images on A630
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Thu, 17 Dec 2020 10:38:49 +0000 (11:38 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 18 Jan 2021 16:32:21 +0000 (17:32 +0100)
Fixes GPU hangs in dEQP-VK.renderpass2.depth_stencil_resolve.* tests
on A630.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8381>

.gitlab-ci/deqp-freedreno-a630-bypass-fails.txt
.gitlab-ci/deqp-freedreno-a630-fails.txt
src/freedreno/vulkan/tu_formats.c
src/freedreno/vulkan/tu_image.c
src/freedreno/vulkan/tu_private.h

index b622784..76965a3 100644 (file)
@@ -11,4 +11,3 @@ dEQP-GLES31.functional.blend_equation_advanced.srgb.colordodge,Fail
 dEQP-GLES31.functional.blend_equation_advanced.srgb.exclusion,Fail
 dEQP-GLES31.functional.blend_equation_advanced.srgb.multiply,Fail
 dEQP-GLES31.functional.draw_buffers_indexed.overwrite_common.common_blend_eq_buffer_advanced_blend_eq,Fail
-dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_16_64_6.samples_2.d24_unorm_s8_uint.depth_zero,Fail
index cf71d32..31fa5a8 100644 (file)
@@ -31,8 +31,6 @@ dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.depth_compare_greater_eq
 dEQP-VK.pipeline.extended_dynamic_state.before_draw.depth_compare_always_greater,Fail
 dEQP-VK.pipeline.multisample.alpha_to_coverage_unused_attachment.samples_4.alpha_invisible,Fail
 dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_sampler,Crash
-dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_16_64_6.samples_2.d24_unorm_s8_uint.depth_zero,Fail
-dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_16_64_6.samples_4.x8_d24_unorm_pack32.depth_zero,Fail
 dEQP-VK.renderpass2.suballocation.attachment_allocation.input_output.7,Fail
 dEQP-VK.spirv_assembly.instruction.graphics.opquantize.carry_to_exponent_tesse,Fail
 dEQP-VK.spirv_assembly.instruction.graphics.opquantize.negative_round_up_or_round_down_tesse,Fail
index fe0fd5e..7f6e5e6 100644 (file)
@@ -500,7 +500,7 @@ tu_GetPhysicalDeviceFormatProperties2(
 
       /* note: ubwc_possible() argument values to be ignored except for format */
       if (pFormatProperties->formatProperties.optimalTilingFeatures &&
-          ubwc_possible(format, VK_IMAGE_TYPE_2D, 0, false)) {
+          ubwc_possible(format, VK_IMAGE_TYPE_2D, 0, false, VK_SAMPLE_COUNT_1_BIT)) {
          vk_outarray_append(&out, mod_props) {
             mod_props->drmFormatModifier = DRM_FORMAT_MOD_QCOM_COMPRESSED;
             mod_props->drmFormatModifierPlaneCount = 1;
@@ -547,7 +547,8 @@ tu_get_image_format_properties(
          if (info->flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT)
             return VK_ERROR_FORMAT_NOT_SUPPORTED;
 
-         if (!ubwc_possible(info->format, info->type, info->usage, physical_device->info.a6xx.has_z24uint_s8uint))
+
+         if (!ubwc_possible(info->format, info->type, info->usage, physical_device->info.a6xx.has_z24uint_s8uint, sampleCounts))
             return VK_ERROR_FORMAT_NOT_SUPPORTED;
 
          format_feature_flags = format_props.optimalTilingFeatures;
index 56e11e1..c602f4b 100644 (file)
@@ -447,7 +447,8 @@ tu_image_view_init(struct tu_image_view *iview,
 }
 
 bool
-ubwc_possible(VkFormat format, VkImageType type, VkImageUsageFlags usage, bool has_z24uint_s8uint)
+ubwc_possible(VkFormat format, VkImageType type, VkImageUsageFlags usage, bool has_z24uint_s8uint,
+              VkSampleCountFlagBits samples)
 {
    /* no UBWC with compressed formats, E5B9G9R9, S8_UINT
     * (S8_UINT because separate stencil doesn't have UBWC-enable bit)
@@ -490,6 +491,9 @@ ubwc_possible(VkFormat format, VkImageType type, VkImageUsageFlags usage, bool h
        (usage & (VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)))
       return false;
 
+   if (!has_z24uint_s8uint && samples > VK_SAMPLE_COUNT_1_BIT)
+      return false;
+
    return true;
 }
 
@@ -595,7 +599,7 @@ tu_CreateImage(VkDevice _device,
    }
 
    if (!ubwc_possible(image->vk_format, pCreateInfo->imageType, pCreateInfo->usage,
-                      device->physical_device->info.a6xx.has_z24uint_s8uint))
+                      device->physical_device->info.a6xx.has_z24uint_s8uint, pCreateInfo->samples))
       ubwc_enabled = false;
 
    /* expect UBWC enabled if we asked for it */
index 053a68b..de672fb 100644 (file)
@@ -1396,7 +1396,8 @@ tu_image_view_init(struct tu_image_view *iview,
                    bool limited_z24s8);
 
 bool
-ubwc_possible(VkFormat format, VkImageType type, VkImageUsageFlags usage, bool limited_z24s8);
+ubwc_possible(VkFormat format, VkImageType type, VkImageUsageFlags usage, bool limited_z24s8,
+              VkSampleCountFlagBits samples);
 
 struct tu_buffer_view
 {