Mesa (master): radv: Add debug option to dump meta shaders.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 26 13:58:00 UTC 2019


Module: Mesa
Branch: master
Commit: 30f0c0ea7db129dafb2e879de8faad6907a09791
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=30f0c0ea7db129dafb2e879de8faad6907a09791

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Wed Sep 18 14:39:10 2019 +0200

radv: Add debug option to dump meta shaders.

This new option can help debug shader compiler problems when
there are issues with the meta shaders.

Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_debug.h  | 1 +
 src/amd/vulkan/radv_device.c | 1 +
 src/amd/vulkan/radv_shader.c | 6 ++++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
index ca71d535f2a..2d35f4e1386 100644
--- a/src/amd/vulkan/radv_debug.h
+++ b/src/amd/vulkan/radv_debug.h
@@ -55,6 +55,7 @@ enum {
 	RADV_DEBUG_NO_NGG            = 0x2000000,
 	RADV_DEBUG_NO_SHADER_BALLOT  = 0x4000000,
 	RADV_DEBUG_ALL_ENTRYPOINTS   = 0x8000000,
+	RADV_DEBUG_DUMP_META_SHADERS = 0x10000000,
 };
 
 enum {
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index ea132ee8bc4..1da49cb6093 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -486,6 +486,7 @@ static const struct debug_control radv_debug_options[] = {
 	{"nongg", RADV_DEBUG_NO_NGG},
 	{"noshaderballot", RADV_DEBUG_NO_SHADER_BALLOT},
 	{"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS},
+	{"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
 	{NULL, 0}
 };
 
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index eb0886bd1f8..086f7cd8616 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -119,9 +119,11 @@ radv_can_dump_shader(struct radv_device *device,
 {
 	if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS))
 		return false;
+	if (module)
+		return !module->nir ||
+			(device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS);
 
-	/* Only dump non-meta shaders, useful for debugging purposes. */
-	return (module && !module->nir) || is_gs_copy_shader;
+	return is_gs_copy_shader;
 }
 
 bool




More information about the mesa-commit mailing list