From 061bf72a4fdc25153b1f86d9df95ccba8b4638f6 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 27 Jan 2022 10:55:35 -0500 Subject: [PATCH] mesa: stop truncating MESA_GLSL=dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/mesa/main/errors.c | 5 +++++ src/mesa/main/errors.h | 4 ++++ src/mesa/main/shaderapi.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index b1836ba26cf..10fe3fcb395 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -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. diff --git a/src/mesa/main/errors.h b/src/mesa/main/errors.h index 5bed45c4fe9..705b482e9dd 100644 --- a/src/mesa/main/errors.h +++ b/src/mesa/main/errors.h @@ -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); diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index bfc17b5deb9..a3af026481e 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -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);