diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-02-20 19:02:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-02-21 03:33:56 +0300 |
commit | 764082676b4c8761573f5e7b91e004a3a83f2ec7 (patch) | |
tree | 4eeb611721e2979a15ead50bb94b7fd47ceb06c5 /source/blender/gpu/intern/gpu_shader.cc | |
parent | 6fa984a1afaadcfd5d7a630da4c44bdee4676bd5 (diff) |
GPU: Add define to ouput more context lines for GLSL errors
This is work in progress, but it is very useful even as it is.
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc index 97673e92bcf..bb657ff1645 100644 --- a/source/blender/gpu/intern/gpu_shader.cc +++ b/source/blender/gpu/intern/gpu_shader.cc @@ -166,6 +166,11 @@ void Shader::print_log(Span<const char *> sources, char *log, const char *stage, found_line_id = true; break; } +/* TODO(fclem) Make this an option to display N lines before error. */ +#if 0 /* Uncomment to print shader file up to the error line to have more context. */ + BLI_dynstr_appendf(dynstr, "%5d | ", src_line_index); + BLI_dynstr_nappend(dynstr, src_line, (src_line_end + 1) - src_line); +#endif /* Continue to next line. */ src_line = src_line_end + 1; src_line_index++; |