From 29dff2fd7507797c0c6a5e551a70a4112fd8b822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Tue, 25 Nov 2025 14:59:58 +0100 Subject: [PATCH] radv: Check RADV_PERFTEST=sparse for image formats and sparse queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_formats.c | 5 ++++- src/amd/vulkan/radv_physical_device.c | 2 +- src/amd/vulkan/radv_physical_device.h | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c index eb3f92790f3..f09f8b24e23 100644 --- a/src/amd/vulkan/radv_formats.c +++ b/src/amd/vulkan/radv_formats.c @@ -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; diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index a9d7e538605..53265b05343 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -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); diff --git a/src/amd/vulkan/radv_physical_device.h b/src/amd/vulkan/radv_physical_device.h index 0f57f0c6b0e..b9a50569e61 100644 --- a/src/amd/vulkan/radv_physical_device.h +++ b/src/amd/vulkan/radv_physical_device.h @@ -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