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

Author: Samuel Pitoiset <[email protected]>
Date:   Tue Nov  1 11:20:58 2022 +0100

radv: allow to enable NGG streamout with RADV_PERFTEST=ngg_streamout

Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19435>

---

 docs/envvars.rst             | 2 ++
 src/amd/vulkan/radv_debug.h  | 1 +
 src/amd/vulkan/radv_device.c | 4 +++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/envvars.rst b/docs/envvars.rst
index e48324af446..98f223e20d8 100644
--- a/docs/envvars.rst
+++ b/docs/envvars.rst
@@ -801,6 +801,8 @@ RADV driver environment variables
       enable unofficial experimental support for NV_mesh_shader.
    ``pswave32``
       enable wave32 for pixel shaders (GFX10+)
+   ``ngg_streamout``
+      enable NGG streamout
    ``nggc``
       enable NGG culling on GPUs where it's not enabled by default (GFX10.1 
only).
    ``rt``
diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
index 9b1833ed329..57365727201 100644
--- a/src/amd/vulkan/radv_debug.h
+++ b/src/amd/vulkan/radv_debug.h
@@ -85,6 +85,7 @@ enum {
    RADV_PERFTEST_RT_WAVE_64 = 1u << 12,
    RADV_PERFTEST_GPL = 1u << 13,
    RADV_PERFTEST_EXT_MS = 1u << 14,
+   RADV_PERFTEST_NGG_STREAMOUT = 1u << 15,
 };
 
 bool radv_init_trace(struct radv_device *device);
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index b44da810a43..e40205dcdb2 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -871,7 +871,8 @@ radv_physical_device_try_create(struct radv_instance 
*instance, drmDevicePtr drm
                               (device->instance->perftest_flags & 
RADV_PERFTEST_NGGC)) &&
                              !(device->instance->debug_flags & 
RADV_DEBUG_NO_NGGC);
 
-   device->use_ngg_streamout = false;
+   device->use_ngg_streamout = device->use_ngg &&
+                               (device->instance->perftest_flags & 
RADV_PERFTEST_NGG_STREAMOUT);
 
    /* Determine the number of threads per wave for all stages. */
    device->cs_wave_size = 64;
@@ -1062,6 +1063,7 @@ static const struct debug_control radv_perftest_options[] 
= {{"localbos", RADV_P
                                                              {"rtwave64", 
RADV_PERFTEST_RT_WAVE_64},
                                                              {"gpl", 
RADV_PERFTEST_GPL},
                                                              {"ext_ms", 
RADV_PERFTEST_EXT_MS},
+                                                             {"ngg_streamout", 
RADV_PERFTEST_NGG_STREAMOUT},
                                                              {NULL, 0}};
 
 const char *

Reply via email to