i915: Don't log I915_DEBUG=fs output for blit shaders.

Unless you have NIR_DEBUG=print_internal, the rest of the shader debug
pipeline is also hidden.  Cleans up output when looking at shader-db
compiles.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
This commit is contained in:
Emma Anholt
2023-10-03 12:13:36 -07:00
committed by Marge Bot
parent 9c7d94c57e
commit 8e81aff4bb
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -132,6 +132,10 @@ struct i915_fragment_shader {
} texcoords[I915_TEX_UNITS];
bool reads_pntc;
/* Set if the shader is an internal (blit, etc.) shader that shouldn't debug
* log by default. */
bool internal;
};
struct i915_cache_context;
@@ -33,6 +33,7 @@
#include "i915_fpc.h"
#include "i915_reg.h"
#include "nir/nir.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi/tgsi_dump.h"
#include "tgsi/tgsi_info.h"
@@ -1086,8 +1087,10 @@ i915_translate_fragment_program(struct i915_context *i915,
struct i915_fp_compile *p;
const struct tgsi_token *tokens = fs->state.tokens;
struct i915_token_list *i_tokens;
bool debug =
I915_DBG_ON(DBG_FS) && (!fs->internal || NIR_DEBUG(PRINT_INTERNAL));
if (I915_DBG_ON(DBG_FS)) {
if (debug) {
mesa_logi("TGSI fragment shader:");
tgsi_dump(tokens, 0);
}
@@ -1101,7 +1104,7 @@ i915_translate_fragment_program(struct i915_context *i915,
i915_fini_compile(i915, p);
i915_optimize_free(i_tokens);
if (I915_DBG_ON(DBG_FS)) {
if (debug) {
mesa_logi("i915 fragment shader with %d constants%s", fs->num_constants,
fs->num_constants ? ":" : "");
+2
View File
@@ -547,6 +547,7 @@ i915_create_fs_state(struct pipe_context *pipe,
if (templ->type == PIPE_SHADER_IR_NIR) {
nir_shader *s = templ->ir.nir;
ifs->internal = s->info.internal;
static const struct nir_to_tgsi_options ntt_options = {
.lower_fabs = true,
@@ -556,6 +557,7 @@ i915_create_fs_state(struct pipe_context *pipe,
assert(templ->type == PIPE_SHADER_IR_TGSI);
/* we need to keep a local copy of the tokens */
ifs->state.tokens = tgsi_dup_tokens(templ->tokens);
ifs->internal = i915->no_log_program_errors;
}
ifs->state.type = PIPE_SHADER_IR_TGSI;