Mesa (main): radv: Enable task shader feature for NV_mesh_shader.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 20 19:31:57 UTC 2022


Module: Mesa
Branch: main
Commit: 4eb7e539637d04209883731306ec6aa466ab01f3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4eb7e539637d04209883731306ec6aa466ab01f3

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Mon Feb  7 17:31:26 2022 +0100

radv: Enable task shader feature for NV_mesh_shader.

Still hidden behind RADV_PERFTEST=nv_ms but now advertises
task shader support too.

Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16531>

---

 src/amd/ci/radv-skips.txt    |  5 +++++
 src/amd/vulkan/radv_device.c | 18 +++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/amd/ci/radv-skips.txt b/src/amd/ci/radv-skips.txt
index 8bd0eee2259..6bd11858335 100644
--- a/src/amd/ci/radv-skips.txt
+++ b/src/amd/ci/radv-skips.txt
@@ -54,3 +54,8 @@ dEQP-VK.graphicsfuzz.while-inside-switch
 dEQP-VK.graphicsfuzz.spv-stable-maze-O-dead-code
 dEQP-VK.graphicsfuzz.spv-stable-maze-O-memory-accesses
 dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.uniform_32struct_to_16struct.uniform_buffer_block_geom
+
+# These tests create an ACE cmdbuf which waits for GFX, thus can cause
+# a deadlock when executed in parallel without gang submit.
+dEQP-VK.mesh_shader.nv.synchronization.*
+dEQP-VK.mesh_shader.nv.misc.many_task*
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index e3f8cf3c618..34719878170 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -384,6 +384,14 @@ radv_perf_query_supported(const struct radv_physical_device *pdev)
    return pdev->rad_info.gfx_level == GFX10_3 && !radv_thread_trace_enabled();
 }
 
+static bool
+radv_taskmesh_enabled(const struct radv_physical_device *pdevice)
+{
+   return pdevice->use_ngg && !pdevice->use_llvm && pdevice->rad_info.gfx_level >= GFX10_3 &&
+          !(pdevice->instance->debug_flags & RADV_DEBUG_NO_COMPUTE_QUEUE) &&
+          pdevice->rad_info.has_scheduled_fence_dependency;
+}
+
 #if defined(VK_USE_PLATFORM_WAYLAND_KHR) || defined(VK_USE_PLATFORM_XCB_KHR) ||                    \
    defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_DISPLAY_KHR)
 #define RADV_USE_WSI_PLATFORM
@@ -607,10 +615,11 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
       .GOOGLE_user_type = true,
       .INTEL_shader_integer_functions2 = true,
       .NV_compute_shader_derivatives = true,
-      .NV_device_generated_commands = device->rad_info.gfx_level >= GFX7 && !(device->instance->debug_flags & RADV_DEBUG_NO_IBS) &&
+      .NV_device_generated_commands = device->rad_info.gfx_level >= GFX7 &&
+                                      !(device->instance->debug_flags & RADV_DEBUG_NO_IBS) &&
                                       driQueryOptionb(&device->instance->dri_options, "radv_dgc"),
-      .NV_mesh_shader = device->use_ngg && device->rad_info.gfx_level >= GFX10_3 &&
-                        device->instance->perftest_flags & RADV_PERFTEST_NV_MS && !device->use_llvm,
+      .NV_mesh_shader =
+         radv_taskmesh_enabled(device) && device->instance->perftest_flags & RADV_PERFTEST_NV_MS,
       /* Undocumented extension purely for vkd3d-proton. This check is to prevent anyone else from
        * using it.
        */
@@ -1767,8 +1776,7 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
          VkPhysicalDeviceMeshShaderFeaturesNV *features =
             (VkPhysicalDeviceMeshShaderFeaturesNV *)ext;
-         features->meshShader = true;
-         features->taskShader = false; /* TODO */
+         features->taskShader = features->meshShader = radv_taskmesh_enabled(pdevice);
          break;
       }
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: {



More information about the mesa-commit mailing list