Permalink
Browse files

video: better shader compilation failure log

  • Loading branch information...
fzurita committed Mar 7, 2016
1 parent 6bfa787 commit 4b95f29ac430c9ac9ca4bee183fccb61e50bf014
Showing with 20 additions and 2 deletions.
  1. +20 −2 jni/mupen64plus-video-gliden64/src/OGL3X/GLSLCombiner_ogl3x.cpp
@@ -390,8 +390,26 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
const GLchar * strShaderData = strFragmentShader.data();
glShaderSource(fragmentShader, 1, &strShaderData, NULL);
glCompileShader(fragmentShader);
- if (!checkShaderCompileStatus(fragmentShader))
- LOG(LOG_ERROR, "Error in fragment shader:\n%s\n", strFragmentShader.data());
+ if (!checkShaderCompileStatus(fragmentShader))
+ {
+ int pos = 0;
+ int max = 900;
+ LOG(LOG_ERROR, "Error in fragment shader");
+
+ while(pos < strFragmentShader.length() )
+ {
+ if(strFragmentShader.length() - pos < max)
+ {
+ LOG(LOG_ERROR, "%s", strFragmentShader.substr(pos).data());
+ }
+ else
+ {
+ LOG(LOG_ERROR, "%s", strFragmentShader.substr(pos, max).data());
+ }
+
+ pos += max;
+ }
+ }
m_program = glCreateProgram();
_locate_attributes();

0 comments on commit 4b95f29

Please sign in to comment.