[Mesa-dev] [PATCH 1/1] main: return 0 length when the queried program object's not linked

James Xiong james.xiong at intel.com
Fri Apr 27 01:39:57 UTC 2018


From: "Xiong, James" <james.xiong at intel.com>

Signed-off-by: Xiong, James <james.xiong at intel.com>
---
 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 44b18af..caa4254 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.7.4



More information about the mesa-dev mailing list