radv: Disable sparse mapping when unsupported by VM

Also disable the sparse binding queue and other related features.
Using sparse on GFX6-8 can cause GPU hangs at the moment.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38304>
This commit is contained in:
Timur Kristóf 2025-11-07 10:41:36 +01:00
parent a037443399
commit 1c8881fc60
3 changed files with 7 additions and 3 deletions

View file

@ -1060,6 +1060,9 @@ 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_vm_mappings)
goto unsupported;
/* Sparse resources with multi-planar formats are unsupported. */
if (vk_format_get_plane_count(format) > 1)
goto unsupported;

View file

@ -874,7 +874,7 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc
.shaderFloat64 = true,
.shaderInt64 = true,
.shaderInt16 = true,
.sparseBinding = true,
.sparseBinding = pdev->info.has_sparse_vm_mappings,
.sparseResidencyBuffer = pdev->info.family >= CHIP_POLARIS10,
.sparseResidencyImage2D = pdev->info.family >= CHIP_POLARIS10,
.sparseResidencyImage3D = pdev->info.family >= CHIP_POLARIS10,
@ -1574,7 +1574,7 @@ radv_get_physical_device_properties(struct radv_physical_device *pdev)
.maxMemoryAllocationCount = UINT32_MAX,
.maxSamplerAllocationCount = 64 * 1024,
.bufferImageGranularity = 1,
.sparseAddressSpaceSize = pdev->info.virtual_address_max,
.sparseAddressSpaceSize = pdev->info.has_sparse_vm_mappings ? pdev->info.virtual_address_max : 0,
.maxBoundDescriptorSets = MAX_SETS,
.maxPerStageDescriptorSamplers = max_descriptor_set_size,
.maxPerStageDescriptorUniformBuffers = max_descriptor_set_size,

View file

@ -240,7 +240,8 @@ 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;
return pdev->info.has_timeline_syncobj &&
pdev->info.has_sparse_vm_mappings;
}
static inline bool