Mesa (main): mesa: stop truncating MESA_GLSL=dump
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 1 04:35:23 UTC 2022
Module: Mesa
Branch: main
Commit: 061bf72a4fdc25153b1f86d9df95ccba8b4638f6
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=061bf72a4fdc25153b1f86d9df95ccba8b4638f6
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Thu Jan 27 10:55:35 2022 -0500
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 at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14755>
---
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);
More information about the mesa-commit
mailing list