From: Xiong, James Date: Fri, 27 Apr 2018 01:39:57 +0000 (-0700) Subject: main: return 0 length when the queried program object's not linked X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08c1444c9582f8654f9c688b79230ba2acbc2027;p=mesa.git main: return 0 length when the queried program object's not linked Signed-off-by: Xiong, James Reviewed-by: Timothy Arceri --- diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 44b18af4927..caa42541cad 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -837,7 +837,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, *params = shProg->BinaryRetreivableHint; return; case GL_PROGRAM_BINARY_LENGTH: - if (ctx->Const.NumProgramBinaryFormats == 0) { + if (ctx->Const.NumProgramBinaryFormats == 0 || !shProg->data->LinkStatus) { *params = 0; } else { _mesa_get_program_binary_length(ctx, shProg, params);