diff options
author | Michael Pohoreski (Ptolemy Linden) <ptolemy@lindenlab.com> | 2019-11-15 15:45:08 -0800 |
---|---|---|
committer | Michael Pohoreski (Ptolemy Linden) <ptolemy@lindenlab.com> | 2019-11-15 15:45:08 -0800 |
commit | 18eb8ac90ce409ba620f6fe8ff487e6195d9c3eb (patch) | |
tree | b4cc893d09fd1d205a6552154e97262720580f1c /indra | |
parent | 7a7f68fb3c09c187f5b6fd333d0292a3fbfbc9df (diff) |
QoL fix: remove extra blank lines for every source line when dumping shader source
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index bce3720d3b..dcb34c6761 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -570,9 +570,20 @@ static std::string get_object_log(GLhandleARB ret) //dump shader source for debugging void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text) { - for (GLuint i = 0; i < shader_code_count; i++) + for (U32 i = 0; i < shader_code_count; i++) { + GLcharARB *line = shader_code_text[i]; + size_t len = strlen( line ); + char last = len > 0 ? line[len - 1] : 0; + + // LL_ENDL already outputs a newline so temporarily strip off the end newline to prevent EVERY line outputting an (extra) blank line + if (last == '\n') + line[len - 1] = 0; + LL_SHADER_LOADING_WARNS() << i << ": " << shader_code_text[i] << LL_ENDL; + + if (last == '\n') + line[len - 1] = '\n'; } LL_SHADER_LOADING_WARNS() << LL_ENDL; } |