radv: use the fragment resolve path by default on GFX11
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 17 May 2022 11:28:02 +0000 (13:28 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 26 May 2022 07:43:38 +0000 (07:43 +0000)
GFX11 doesn't support CB_RESOLVE which means it doesn't support the
hardware resolve path. If necessary (for arrays or integer formats)
the driver will select the compute path.

No CTS regressions by forcing the fragment resolve path on GFX10.3

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16557>

src/amd/vulkan/radv_meta_resolve.c

index a72c124..e37bb6f 100644 (file)
@@ -548,7 +548,10 @@ radv_CmdResolveImage2(VkCommandBuffer commandBuffer,
    RADV_FROM_HANDLE(radv_image, dst_image, pResolveImageInfo->dstImage);
    VkImageLayout src_image_layout = pResolveImageInfo->srcImageLayout;
    VkImageLayout dst_image_layout = pResolveImageInfo->dstImageLayout;
-   enum radv_resolve_method resolve_method = RESOLVE_HW;
+   const struct radv_physical_device *pdevice = cmd_buffer->device->physical_device;
+   enum radv_resolve_method resolve_method =
+      pdevice->rad_info.gfx_level >= GFX11 ? RESOLVE_FRAGMENT : RESOLVE_HW;
+
    /* we can use the hw resolve only for single full resolves */
    if (pResolveImageInfo->regionCount == 1) {
       if (pResolveImageInfo->pRegions[0].srcOffset.x ||
@@ -648,8 +651,10 @@ radv_cmd_buffer_resolve_subpass_hw(struct radv_cmd_buffer *cmd_buffer)
 void
 radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer)
 {
+   const struct radv_physical_device *pdevice = cmd_buffer->device->physical_device;
    const struct radv_subpass *subpass = cmd_buffer->state.subpass;
-   enum radv_resolve_method resolve_method = RESOLVE_HW;
+   enum radv_resolve_method resolve_method =
+      pdevice->rad_info.gfx_level >= GFX11 ? RESOLVE_FRAGMENT : RESOLVE_HW;
 
    if (!subpass->has_color_resolve && !subpass->ds_resolve_attachment)
       return;