radv: Check RADV_PERFTEST=sparse for image formats and sparse queue

Without this, we will report some image formats as unsupported
and the dedicated sparse binding queue won't work
when sparse support is enabled using RADV_PERFTEST=sparse

Fixes: dd90c76cea12 ("radv: Advertise sparse features pre Polaris with perftest flag")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38676>
This commit is contained in:
Timur Kristóf 2025-11-25 14:59:58 +01:00 committed by Marge Bot
parent 1884b03a10
commit 29dff2fd75
3 changed files with 8 additions and 3 deletions

View file

@ -1059,7 +1059,7 @@ radv_get_image_format_properties(struct radv_physical_device *pdev, const VkPhys
}
if (info->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) {
if (!pdev->info.has_sparse)
if (!radv_sparse_enabled(pdev))
goto unsupported;
/* Sparse resources with multi-planar formats are unsupported. */
@ -1072,6 +1072,9 @@ radv_get_image_format_properties(struct radv_physical_device *pdev, const VkPhys
}
if (info->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) {
if (!radv_sparse_enabled(pdev))
goto unsupported;
if (info->type == VK_IMAGE_TYPE_3D && !pdev->info.has_sparse_image_3d)
goto unsupported;

View file

@ -75,7 +75,7 @@ radv_taskmesh_enabled(const struct radv_physical_device *pdev)
pdev->info.has_gang_submit;
}
static bool
bool
radv_sparse_enabled(const struct radv_physical_device *pdev)
{
const struct radv_instance *instance = radv_physical_device_instance(pdev);

View file

@ -229,6 +229,8 @@ struct radv_physical_device {
VK_DEFINE_HANDLE_CASTS(radv_physical_device, vk.base, VkPhysicalDevice, VK_OBJECT_TYPE_PHYSICAL_DEVICE)
bool radv_sparse_enabled(const struct radv_physical_device *pdev);
static inline struct radv_instance *
radv_physical_device_instance(const struct radv_physical_device *pdev)
{
@ -241,7 +243,7 @@ radv_dedicated_sparse_queue_enabled(const struct radv_physical_device *pdev)
/* Dedicated sparse queue requires VK_QUEUE_SUBMIT_MODE_THREADED, which is incompatible with
* VK_DEVICE_TIMELINE_MODE_EMULATED. */
return pdev->info.has_timeline_syncobj &&
pdev->info.has_sparse;
radv_sparse_enabled(pdev);
}
static inline bool