mesa: stop truncating MESA_GLSL=dump

this adds a new helper function that can be used to directly dump longer
strings to the log file, such as shaders

fixes #5614

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14755>
This commit is contained in:
Mike Blumenkrantz
2022-01-27 10:55:35 -05:00
committed by Marge Bot
parent b1b8b712c1
commit 061bf72a4f
3 changed files with 10 additions and 1 deletions

View File

@@ -414,6 +414,11 @@ _mesa_log(const char *fmtString, ...)
output_if_debug(NULL, s, GL_FALSE);
}
void
_mesa_log_direct(const char *string)
{
output_if_debug(NULL, string, GL_TRUE);
}
/**
* Report debug information from the shader compiler via GL_ARB_debug_output.

View File

@@ -66,6 +66,10 @@ _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) PRINTFLI
extern void
_mesa_log(const char *fmtString, ...) PRINTFLIKE(1, 2);
extern void
_mesa_log_direct(const char *string);
extern FILE *
_mesa_get_log_file(void);

View File

@@ -1203,7 +1203,7 @@ _mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh)
if (ctx->_Shader->Flags & GLSL_DUMP) {
_mesa_log("GLSL source for %s shader %d:\n",
_mesa_shader_stage_to_string(sh->Stage), sh->Name);
_mesa_log("%s\n", sh->Source);
_mesa_log_direct(sh->Source);
}
ensure_builtin_types(ctx);