aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-02-18 17:43:07 -0800
committerKenneth Graunke <[email protected]>2015-02-19 15:15:45 -0800
commit2bd139e18c941e7ea0870ba43314a5c10fd5bb12 (patch)
tree8ff4f3d6c55aaec651116d921b24cde522447427 /src
parent7e35a812643982bef5d90f4998a4f240b2edfd26 (diff)
i965/fs: Un-hardcode DEBUG_WM, "FS", and "fragment".
These code paths can (or will) be used for other shader stages. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp11
2 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c46e1d73fd4..a562b8a3b1c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -810,11 +810,11 @@ fs_visitor::vfail(const char *format, va_list va)
failed = true;
msg = ralloc_vasprintf(mem_ctx, format, va);
- msg = ralloc_asprintf(mem_ctx, "FS compile failed: %s\n", msg);
+ msg = ralloc_asprintf(mem_ctx, "%s compile failed: %s\n", stage_abbrev, msg);
this->fail_msg = msg;
- if (INTEL_DEBUG & DEBUG_WM) {
+ if (debug_enabled) {
fprintf(stderr, "%s", msg);
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 21238296d50..90eecae7120 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -124,8 +124,8 @@ fs_visitor::emit_nir_code()
nir_copy_prop(nir);
nir_validate_shader(nir);
- if (INTEL_DEBUG & DEBUG_WM) {
- fprintf(stderr, "NIR (SSA form) for fragment shader:\n");
+ if (unlikely(debug_enabled)) {
+ fprintf(stderr, "NIR (SSA form) for %s shader:\n", stage_name);
nir_print_shader(nir, stderr);
}
@@ -135,7 +135,8 @@ fs_visitor::emit_nir_code()
MESA_DEBUG_SOURCE_SHADER_COMPILER,
MESA_DEBUG_TYPE_OTHER,
MESA_DEBUG_SEVERITY_NOTIFICATION,
- "FS NIR shader: %d inst\n",
+ "%s NIR shader: %d inst\n",
+ stage_abbrev,
count_nir_instrs(nir));
}
@@ -178,8 +179,8 @@ fs_visitor::emit_nir_code()
nir_emit_impl(overload->impl);
}
- if (INTEL_DEBUG & DEBUG_WM) {
- fprintf(stderr, "NIR (final form) for fragment shader:\n");
+ if (unlikely(debug_enabled)) {
+ fprintf(stderr, "NIR (final form) for %s shader:\n", stage_name);
nir_print_shader(nir, stderr);
}