radv: add an option for disabling NGG on GFX10

Submitted by Samuel Pitoiset on July 7, 2019, 5:35 p.m.

Details

Message ID 20190707173502.705-1-samuel.pitoiset@gmail.com
State New
Headers show
Series "radv: add an option for disabling NGG on GFX10" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset July 7, 2019, 5:35 p.m.
Will be useful for testing the legacy path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/vulkan/radv_debug.h    | 1 +
 src/amd/vulkan/radv_device.c   | 1 +
 src/amd/vulkan/radv_pipeline.c | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
index 75e28000e14..723fabda57f 100644
--- a/src/amd/vulkan/radv_debug.h
+++ b/src/amd/vulkan/radv_debug.h
@@ -52,6 +52,7 @@  enum {
 	RADV_DEBUG_NOTHREADLLVM      = 0x400000,
 	RADV_DEBUG_NOBINNING         = 0x800000,
 	RADV_DEBUG_NO_LOAD_STORE_OPT = 0x1000000,
+	RADV_DEBUG_NO_NGG            = 0x2000000,
 };
 
 enum {
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 4a1078a1b52..5a92e5276d9 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -474,6 +474,7 @@  static const struct debug_control radv_debug_options[] = {
 	{"nothreadllvm", RADV_DEBUG_NOTHREADLLVM},
 	{"nobinning", RADV_DEBUG_NOBINNING},
 	{"noloadstoreopt", RADV_DEBUG_NO_LOAD_STORE_OPT},
+	{"nongg", RADV_DEBUG_NO_NGG},
 	{NULL, 0}
 };
 
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 69acfdaec7d..db0fb50bbe7 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2253,7 +2253,8 @@  radv_fill_shader_keys(struct radv_device *device,
 			keys[MESA_SHADER_VERTEX].vs.out.as_es = true;
 	}
 
-	if (device->physical_device->rad_info.chip_class >= GFX10) {
+	if (!(device->instance->debug_flags & RADV_DEBUG_NO_NGG) &&
+	    device->physical_device->rad_info.chip_class >= GFX10) {
 		keys[MESA_SHADER_VERTEX].vs.out.as_ngg = true;
 	}
 

Comments

Please add the option to get_hash_flags in radv_pipeline.c too, so it
does not poison the cache.

On Sun, Jul 7, 2019 at 7:35 PM Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
>
> Will be useful for testing the legacy path.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  src/amd/vulkan/radv_debug.h    | 1 +
>  src/amd/vulkan/radv_device.c   | 1 +
>  src/amd/vulkan/radv_pipeline.c | 3 ++-
>  3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
> index 75e28000e14..723fabda57f 100644
> --- a/src/amd/vulkan/radv_debug.h
> +++ b/src/amd/vulkan/radv_debug.h
> @@ -52,6 +52,7 @@ enum {
>         RADV_DEBUG_NOTHREADLLVM      = 0x400000,
>         RADV_DEBUG_NOBINNING         = 0x800000,
>         RADV_DEBUG_NO_LOAD_STORE_OPT = 0x1000000,
> +       RADV_DEBUG_NO_NGG            = 0x2000000,
>  };
>
>  enum {
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index 4a1078a1b52..5a92e5276d9 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -474,6 +474,7 @@ static const struct debug_control radv_debug_options[] = {
>         {"nothreadllvm", RADV_DEBUG_NOTHREADLLVM},
>         {"nobinning", RADV_DEBUG_NOBINNING},
>         {"noloadstoreopt", RADV_DEBUG_NO_LOAD_STORE_OPT},
> +       {"nongg", RADV_DEBUG_NO_NGG},
>         {NULL, 0}
>  };
>
> diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
> index 69acfdaec7d..db0fb50bbe7 100644
> --- a/src/amd/vulkan/radv_pipeline.c
> +++ b/src/amd/vulkan/radv_pipeline.c
> @@ -2253,7 +2253,8 @@ radv_fill_shader_keys(struct radv_device *device,
>                         keys[MESA_SHADER_VERTEX].vs.out.as_es = true;
>         }
>
> -       if (device->physical_device->rad_info.chip_class >= GFX10) {
> +       if (!(device->instance->debug_flags & RADV_DEBUG_NO_NGG) &&
> +           device->physical_device->rad_info.chip_class >= GFX10) {
>                 keys[MESA_SHADER_VERTEX].vs.out.as_ngg = true;
>         }
>
> --
> 2.22.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev