From f65290f6f9b63a9d3e547ff41f3cd017aa936a05 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 4 Oct 2024 13:53:28 +0200 Subject: [PATCH] radv: advertise VK_KHR_copy_memory_indirect on GFX8+ GFX6-7 don't support indirect unaligned dispatches. Signed-off-by: Samuel Pitoiset Part-of: --- docs/features.txt | 2 +- docs/relnotes/new_features.txt | 2 +- src/amd/vulkan/radv_physical_device.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index b3a1b7eefd0..ec6bba81fd2 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -540,7 +540,7 @@ Khronos extensions that are not part of any Vulkan version: VK_KHR_calibrated_timestamps DONE (anv, hk, kk, nvk, panvk/v10+, radv, tu/a750+, vn) VK_KHR_compute_shader_derivatives DONE (anv, lvp, nvk, radv, tu, vn) VK_KHR_cooperative_matrix DONE (anv, nvk/Turing+, radv/gfx11+, vn) - VK_KHR_copy_memory_indirect DONE (nvk) + VK_KHR_copy_memory_indirect DONE (nvk, radv/gfx8+) VK_KHR_depth_clamp_zero_one DONE (anv, nvk, panvk, radv, tu, vn) VK_KHR_deferred_host_operations DONE (anv, hasvk, lvp, radv, tu, vn) VK_KHR_display DONE (anv, nvk, panvk, pvr, radv, tu, v3dv, vn) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index 03555c24632..c91801365ae 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -14,7 +14,7 @@ VK_EXT_zero_initialize_device_memory on panvk GL_EXT_shader_image_load_store on panfrost VK_KHR_swapchain_mutable_format on panvk VK_EXT_astc_decode_mode on panvk -VK_KHR_copy_memory_indirect on nvk +VK_KHR_copy_memory_indirect on nvk, RADV/GFX8+ VK_EXT_color_write_enable on panvk VK_EXT_image_view_min_lod on panvk VK_EXT_depth_clamp_control on panvk diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index e62ef2f43a0..ff8009caeb3 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -630,6 +630,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device .KHR_bind_memory2 = true, .KHR_buffer_device_address = true, .KHR_copy_commands2 = true, + .KHR_copy_memory_indirect = pdev->info.gfx_level >= GFX8, .KHR_create_renderpass2 = true, .KHR_dedicated_allocation = true, .KHR_deferred_host_operations = true, @@ -1526,6 +1527,10 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc .shaderMixedFloatDotProductFloat16AccFloat16 = pdev->info.gfx_level >= GFX11, .shaderMixedFloatDotProductBFloat16Acc = radv_bfloat16_enabled(pdev), .shaderMixedFloatDotProductFloat8AccFloat32 = pdev->info.gfx_level >= GFX12, + + /* VK_KHR_copy_memory_indirect */ + .indirectMemoryCopy = pdev->info.gfx_level >= GFX8, + .indirectMemoryToImageCopy = pdev->info.gfx_level >= GFX8, }; } @@ -1645,6 +1650,12 @@ radv_get_physical_device_properties(struct radv_physical_device *pdev) radv_init_image_properties(pdev); + VkQueueFlags copy_memory_indirect_queues = 0; + if (radv_graphics_queue_enabled(pdev)) + copy_memory_indirect_queues |= VK_QUEUE_GRAPHICS_BIT; + if (radv_compute_queue_enabled(pdev)) + copy_memory_indirect_queues |= VK_QUEUE_COMPUTE_BIT; + pdev->vk.properties = (struct vk_properties){ #ifdef ANDROID_STRICT .apiVersion = RADV_API_VERSION, @@ -2210,6 +2221,9 @@ radv_get_physical_device_properties(struct radv_physical_device *pdev) .rgba4OpaqueBlackSwizzled = true, .resolveSrgbFormatAppliesTransferFunction = true, .resolveSrgbFormatSupportsTransferFunctionControl = true, + + /* VK_KHR_copy_memory_indirect */ + .supportedQueues = copy_memory_indirect_queues, }; struct vk_properties *p = &pdev->vk.properties;