From 08c1444c9582f8654f9c688b79230ba2acbc2027 Mon Sep 17 00:00:00 2001 From: "Xiong, James" Date: Thu, 26 Apr 2018 18:39:57 -0700 Subject: [PATCH] main: return 0 length when the queried program object's not linked Signed-off-by: Xiong, James Reviewed-by: Timothy Arceri --- src/mesa/main/shaderapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2