On Wed, 2016-08-17 at 11:18 +0300, Tapani Pälli wrote: > In case we have empty log (""), we should return 0. This fixes > Khronos WebGL conformance test 'program-infolog'. > > From OpenGL ES 3.1 (and OpenGL 4.5 Core) spec: > "If pname is INFO_LOG_LENGTH , the length of the info log, > including > a null terminator, is returned. If there is no info log, zero is > returned."
Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> > Signed-off-by: Tapani Pälli <tapani.pa...@intel.com> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97321 > --- > src/mesa/main/shaderapi.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c > index 4f29cd9..b2b3b0a 100644 > --- a/src/mesa/main/shaderapi.c > +++ b/src/mesa/main/shaderapi.c > @@ -654,7 +654,8 @@ get_programiv(struct gl_context *ctx, GLuint > program, GLenum pname, > *params = shProg->Validated; > return; > case GL_INFO_LOG_LENGTH: > - *params = shProg->InfoLog ? strlen(shProg->InfoLog) + 1 : 0; > + *params = (shProg->InfoLog && shProg->InfoLog[0] != 0) ? > + strlen(shProg->InfoLog) + 1 : 0; > return; > case GL_ATTACHED_SHADERS: > *params = shProg->NumShaders; _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev