summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-01-19 23:11:54 -0800
committerKenneth Graunke <[email protected]>2015-01-23 14:53:26 -0800
commitf3e06fcc6add67ed3eeecbce600994ef3220ec1c (patch)
treef732ad2ec125b5b8c61ea7ac0af832fe22ce5104
parentfaa38e16aadd9f2a2416fcb5087d7f8fc8178bf2 (diff)
i965/nir: Print NIR on INTEL_DEBUG=fs.
This is useful for debugging and looking for optimization opportunities. It will need to be expanded when we add support for other scalar stages. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 40a16736489..2d303210190 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -93,6 +93,12 @@ fs_visitor::emit_nir_code()
nir_validate_shader(nir);
nir_copy_prop(nir);
nir_validate_shader(nir);
+
+ if (INTEL_DEBUG & DEBUG_WM) {
+ fprintf(stderr, "NIR (SSA form) for fragment shader:\n");
+ nir_print_shader(nir, stderr);
+ }
+
nir_convert_from_ssa(nir);
nir_validate_shader(nir);
nir_lower_vec_to_movs(nir);
@@ -134,6 +140,11 @@ fs_visitor::emit_nir_code()
nir_emit_impl(overload->impl);
}
+ if (INTEL_DEBUG & DEBUG_WM) {
+ fprintf(stderr, "NIR (final form) for fragment shader:\n");
+ nir_print_shader(nir, stderr);
+ }
+
ralloc_free(nir);
}