It's really annoying and this pollutes the output especially
when a bunch of non-meta shaders are compiled.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
radv_link_shaders(pipeline, nir);
for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
- if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS))
- continue;
-
- if (modules[i])
+ if (modules[i] && radv_can_dump_shader(device, modules[i]))
nir_print_shader(nir[i], stderr);
}
unsigned *code_size_out)
{
enum radeon_family chip_family = device->physical_device->rad_info.family;
- bool dump_shaders = device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS;
+ bool dump_shaders = radv_can_dump_shader(device, module);
enum ac_target_machine_options tm_options = 0;
struct radv_shader_variant *variant;
struct ac_shader_binary binary;
#ifndef RADV_SHADER_H
#define RADV_SHADER_H
+#include "radv_debug.h"
#include "radv_private.h"
#include "nir/nir.h"
gl_shader_stage stage,
FILE *file);
+static inline bool
+radv_can_dump_shader(struct radv_device *device,
+ struct radv_shader_module *module)
+{
+ /* Only dump non-meta shaders, useful for debugging purposes. */
+ return !module->nir &&
+ device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS;
+}
+
#endif