i915g: Log program compile errors to mesa_loge().

Now these major driver failures are no longer hidden under -DDEBUG, and
would also work on android (you know, if you cared).  We do want to
suppress logging for u_blitter shaders that fail to compile during
util_blitter_cache_all_shaders().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617>
This commit is contained in:
Emma Anholt 2021-06-27 14:15:41 -07:00
parent 7921648cd6
commit 8259ff0d22
4 changed files with 13 additions and 8 deletions

View File

@ -220,7 +220,9 @@ i915_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
assert(i915->blitter);
/* must be done before installing Draw stages */
i915->no_log_program_errors = true;
util_blitter_cache_all_shaders(i915->blitter);
i915->no_log_program_errors = false;
draw_install_aaline_stage(i915->draw, &i915->base);
draw_install_aapoint_stage(i915->draw, &i915->base);

View File

@ -295,6 +295,8 @@ struct i915_context {
int fired_vertices;
int queued_vertices;
bool no_log_program_errors;
/** blitter/hw-clear */
struct blitter_context *blitter;
};

View File

@ -75,6 +75,7 @@ struct i915_fp_compile {
uint nr_alu_insn;
uint nr_decl_insn;
bool log_program_errors;
boolean error; /**< Set if i915_program_error() is called */
uint NumNativeInstructions;
uint NumNativeAluInstructions;

View File

@ -107,15 +107,13 @@ i915_use_passthrough_shader(struct i915_fragment_shader *fs)
void
i915_program_error(struct i915_fp_compile *p, const char *msg, ...)
{
va_list args;
char buffer[1024];
if (p->log_program_errors) {
va_list args;
debug_printf("i915_program_error: ");
va_start(args, msg);
vsnprintf(buffer, sizeof(buffer), msg, args);
va_end(args);
debug_printf("%s", buffer);
debug_printf("\n");
va_start(args, msg);
mesa_loge_v(msg, args);
va_end(args);
}
p->error = 1;
}
@ -943,6 +941,8 @@ i915_init_compile(struct i915_context *i915, struct i915_fragment_shader *ifs)
for (i = 0; i < I915_TEX_UNITS; i++)
ifs->generic_mapping[i] = -1;
p->log_program_errors = !i915->no_log_program_errors;
p->first_instruction = TRUE;
p->nr_tex_indirect = 1; /* correct? */