Mesa (master): radv: allow to dump the GS copy shader with RADV_DEBUG="shaders"

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Mon May 14 10:37:43 UTC 2018


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri May 11 16:36:02 2018 +0200

radv: allow to dump the GS copy shader with RADV_DEBUG="shaders"

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/amd/vulkan/radv_pipeline.c | 2 +-
 src/amd/vulkan/radv_shader.c   | 2 +-
 src/amd/vulkan/radv_shader.h   | 9 ++++++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index d443f8271e..e6ac0721dc 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1984,7 +1984,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
 		radv_link_shaders(pipeline, nir);
 
 	for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
-		if (modules[i] && radv_can_dump_shader(device, modules[i]))
+		if (modules[i] && radv_can_dump_shader(device, modules[i], false))
 			nir_print_shader(nir[i], stderr);
 	}
 
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index fde6309c97..dfe63d60d4 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -484,7 +484,7 @@ shader_variant_create(struct radv_device *device,
 
 	options->family = chip_family;
 	options->chip_class = device->physical_device->rad_info.chip_class;
-	options->dump_shader = radv_can_dump_shader(device, module);
+	options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader);
 	options->dump_preoptir = options->dump_shader &&
 				 device->instance->debug_flags & RADV_DEBUG_PREOPTIR;
 	options->record_llvm_ir = device->keep_shader_info;
diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
index 182b69849c..12878307ec 100644
--- a/src/amd/vulkan/radv_shader.h
+++ b/src/amd/vulkan/radv_shader.h
@@ -329,11 +329,14 @@ radv_shader_dump_stats(struct radv_device *device,
 
 static inline bool
 radv_can_dump_shader(struct radv_device *device,
-		     struct radv_shader_module *module)
+		     struct radv_shader_module *module,
+		     bool is_gs_copy_shader)
 {
+	if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS))
+		return false;
+
 	/* Only dump non-meta shaders, useful for debugging purposes. */
-	return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS &&
-	       module && !module->nir;
+	return (module && !module->nir) || is_gs_copy_shader;
 }
 
 static inline bool




More information about the mesa-commit mailing list