diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2020-04-07 16:21:39 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2020-04-07 16:21:39 -0700 |
commit | e4f72db20d4ed2510557449a8f1a66a052c07bea (patch) | |
tree | c5c5f96fc93b613d91e200ba2030ed6a32989cf6 /indra/llrender | |
parent | 9e8e623197185e340d94694e55f2ab25827cfaf0 (diff) |
SL-10449: Add dumping of shader to log file
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 86eea458c5..539091c1aa 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -569,12 +569,18 @@ static std::string get_object_log(GLhandleARB ret) //dump shader source for debugging void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text) -{ +{ + char num_str[16]; // U32 = max 10 digits + + LL_SHADER_LOADING_WARNS() << "\n"; + for (U32 i = 0; i < shader_code_count; i++) { - fprintf(stderr, "%4d: %s", i+1, shader_code_text[i]); + snprintf(num_str, sizeof(num_str), "%4d: ", i+1); + std::string line_number(num_str); + LL_CONT << line_number << shader_code_text[i]; } - LL_SHADER_LOADING_WARNS() << LL_ENDL; + LL_CONT << LL_ENDL; } void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string& filename) |