summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pipelineobj.c
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2016-08-17 10:37:45 +0300
committerTapani Pälli <[email protected]>2016-11-18 07:42:41 +0200
commitec4e71f75e9b8a1c427994efa32a61593e3172f9 (patch)
treeb43550f7c127c4b18e6d915da4556451c509ceec /src/mesa/main/pipelineobj.c
parent5ec3a7333fd77698610755d51e42094376e11d01 (diff)
mesa: fix empty program log length
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." v2: apply same fix for get_shaderiv and _mesa_GetProgramPipelineiv (Ian) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97321 Cc: "13.0" <[email protected]>
Diffstat (limited to 'src/mesa/main/pipelineobj.c')
-rw-r--r--src/mesa/main/pipelineobj.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 82298409ee1..310b745ebc8 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -645,7 +645,8 @@ _mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params)
*params = pipe->ActiveProgram ? pipe->ActiveProgram->Name : 0;
return;
case GL_INFO_LOG_LENGTH:
- *params = pipe->InfoLog ? strlen(pipe->InfoLog) + 1 : 0;
+ *params = (pipe->InfoLog && pipe->InfoLog[0] != '\0') ?
+ strlen(pipe->InfoLog) + 1 : 0;
return;
case GL_VALIDATE_STATUS:
*params = pipe->Validated;