From 05933fb0f7eb39cec6a709e9bf7d31adf6fc04eb Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Tue, 23 Mar 2021 11:38:28 -0700 Subject: [PATCH] intel/compiler: Use INTEL_DEBUG=blorp to dump blorp shaders Make INTEL_DEBUG=blorp dump the blorp shaders instead using the general INTEL_DEBUG=fs,vs, which is now reserved to the actual FS and VS shaders used by the pipeline. Reviewed-by: Kenneth Graunke Reviewed-by: Jordan Justen Part-of: --- src/intel/blorp/blorp.c | 5 +++++ src/intel/compiler/brw_compiler.h | 6 ++++++ src/intel/compiler/brw_fs.cpp | 3 ++- src/intel/compiler/brw_vec4.cpp | 3 ++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c index b794c6f496e..04813e476ac 100644 --- a/src/intel/blorp/blorp.c +++ b/src/intel/blorp/blorp.c @@ -28,6 +28,7 @@ #include "blorp_priv.h" #include "compiler/brw_compiler.h" #include "compiler/brw_nir.h" +#include "dev/gen_debug.h" const char * blorp_shader_type_to_name(enum blorp_shader_type type) @@ -223,6 +224,8 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx, .use_rep_send = use_repclear, .log_data = blorp->driver_ctx, + + .debug_flag = DEBUG_BLORP, }; return brw_compile_fs(compiler, mem_ctx, ¶ms); @@ -256,6 +259,8 @@ blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx, .key = &vs_key, .prog_data = vs_prog_data, .log_data = blorp->driver_ctx, + + .debug_flag = DEBUG_BLORP, }; return brw_compile_vs(compiler, mem_ctx, ¶ms); diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index d8388b90db4..ded2ccc4947 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -1453,6 +1453,9 @@ struct brw_compile_vs_params { void *log_data; char *error_str; + + /* If unset, DEBUG_VS is used. */ + uint64_t debug_flag; }; /** @@ -1570,6 +1573,9 @@ struct brw_compile_fs_params { void *log_data; char *error_str; + + /* If unset, DEBUG_WM is used. */ + uint64_t debug_flag; }; /** diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 07ff18d9fbf..457b781c182 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -9063,7 +9063,8 @@ brw_compile_fs(const struct brw_compiler *compiler, const struct brw_wm_prog_key *key = params->key; struct brw_wm_prog_data *prog_data = params->prog_data; bool allow_spilling = params->allow_spilling; - const bool debug_enabled = INTEL_DEBUG & DEBUG_WM; + const bool debug_enabled = + INTEL_DEBUG & (params->debug_flag ? params->debug_flag : DEBUG_WM); prog_data->base.stage = MESA_SHADER_FRAGMENT; diff --git a/src/intel/compiler/brw_vec4.cpp b/src/intel/compiler/brw_vec4.cpp index 5bffdde40af..a909c14dea1 100644 --- a/src/intel/compiler/brw_vec4.cpp +++ b/src/intel/compiler/brw_vec4.cpp @@ -2837,7 +2837,8 @@ brw_compile_vs(const struct brw_compiler *compiler, struct nir_shader *nir = params->nir; const struct brw_vs_prog_key *key = params->key; struct brw_vs_prog_data *prog_data = params->prog_data; - const bool debug_enabled = INTEL_DEBUG & DEBUG_VS; + const bool debug_enabled = + INTEL_DEBUG & (params->debug_flag ? params->debug_flag : DEBUG_VS); prog_data->base.base.stage = MESA_SHADER_VERTEX;