radv: add RADV_DEBUG=nongg_gs for GFX10/GFX10.3

NGG GS doesn't perform well in some cases and having an option to
disable it for performance experiments is very useful.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27518>
This commit is contained in:
Samuel Pitoiset 2024-02-08 10:34:03 +01:00 committed by Marge Bot
parent 877d9678f5
commit 69d734a8d5
4 changed files with 10 additions and 2 deletions

View File

@ -1278,6 +1278,8 @@ RADV driver environment variables
disable NGG for GFX10 and GFX10.3
``nonggc``
disable NGG culling on GPUs where it's enabled by default (GFX10.3 only).
``nongg_gs``
disable NGG GS for GFX10 and GFX10.3
``nort``
skip executing vkCmdTraceRays and ray queries (RT extensions will still be
advertised)

View File

@ -72,6 +72,7 @@ enum {
RADV_DEBUG_VIDEO_ARRAY_PATH = 1ull << 41,
RADV_DEBUG_NO_RT = 1ull << 42,
RADV_DEBUG_NO_MESH_SHADER = 1ull << 43,
RADV_DEBUG_NO_NGG_GS = 1ull << 44,
};
enum {

View File

@ -77,6 +77,7 @@ static const struct debug_control radv_debug_options[] = {{"nofastclears", RADV_
{"videoarraypath", RADV_DEBUG_VIDEO_ARRAY_PATH},
{"nort", RADV_DEBUG_NO_RT},
{"nomeshshader", RADV_DEBUG_NO_MESH_SHADER},
{"nongg_gs", RADV_DEBUG_NO_NGG_GS},
{NULL, 0}};
const char *

View File

@ -2026,8 +2026,12 @@ radv_fill_shader_info_ngg(struct radv_device *device, struct radv_shader_stage *
}
}
if (last_vgt_stage && last_vgt_stage->nir->xfb_info) {
/* Disable NGG because GFX10/GFX10.3 don't support NGG streamout. */
if ((last_vgt_stage && last_vgt_stage->nir->xfb_info) ||
((device->instance->debug_flags & RADV_DEBUG_NO_NGG_GS) && stages[MESA_SHADER_GEOMETRY].nir)) {
/* NGG needs to be disabled on GFX10/GFX10.3 when:
* - streamout is used because NGG streamout isn't supported
* - NGG GS is explictly disabled to workaround performance issues
*/
if (stages[MESA_SHADER_TESS_EVAL].nir)
stages[MESA_SHADER_TESS_EVAL].info.is_ngg = false;
else