radv: Do the sample check for tiling earlier.

The LINEAR optimization is not allowed for MSAA images.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7594>
This commit is contained in:
Bas Nieuwenhuizen 2020-11-13 02:44:48 +01:00
parent dad6b62576
commit 9acfbe3022

View file

@ -47,6 +47,10 @@ radv_choose_tiling(struct radv_device *device,
return RADEON_SURF_MODE_LINEAR_ALIGNED;
}
/* MSAA resources must be 2D tiled. */
if (pCreateInfo->samples > 1)
return RADEON_SURF_MODE_2D;
if (!vk_format_is_compressed(format) &&
!vk_format_is_depth_or_stencil(format)
&& device->physical_device->rad_info.chip_class <= GFX8) {
@ -59,10 +63,6 @@ radv_choose_tiling(struct radv_device *device,
return RADEON_SURF_MODE_LINEAR_ALIGNED;
}
/* MSAA resources must be 2D tiled. */
if (pCreateInfo->samples > 1)
return RADEON_SURF_MODE_2D;
return RADEON_SURF_MODE_2D;
}