OSDN Git Service

mesa: fix empty program log length
authorTapani Pälli <tapani.palli@intel.com>
Wed, 17 Aug 2016 07:37:45 +0000 (10:37 +0300)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 24 Nov 2016 16:34:41 +0000 (16:34 +0000)
commit8691daef62d3a40014757426c3f25960095b8d3c
treea117105c63f8773cdcc2f5fc2228d0fa384c3e87
parent1809f17bda56d4f9d6385f63a9c4a5df890e3cad
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 <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97321
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ec4e71f75e9b8a1c427994efa32a61593e3172f9)
src/mesa/main/pipelineobj.c
src/mesa/main/shaderapi.c