Mesa (master): mesa: return initial value for PROGRAM_SEPARABLE when not linked

Tapani Pälli tpalli at kemper.freedesktop.org
Thu Sep 17 05:41:58 UTC 2015


Module: Mesa
Branch: master
Commit: d9689be5c67e71518ef8687fd7fc4bc6df25b93f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9689be5c67e71518ef8687fd7fc4bc6df25b93f

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Tue Sep  1 13:53:43 2015 +0300

mesa: return initial value for PROGRAM_SEPARABLE when not linked

>From OpenGL ES 3.1 spec (7.12):

    "Most properties set within program objects are specified not to
    take effect until the next call to LinkProgram or ProgramBinary.
    Some properties further require a successful call to either of
    these commands before taking effect. GetProgramiv returns the
    properties currently in effect for program, which may differ from
    the properties set within program since the most recent call to
    LinkProgram or ProgramBinary, which have not yet taken effect. If
    there has been no such call putting changes to pname into effect,
    initial values are returned."

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt at intel.com>

---

 src/mesa/main/shaderapi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 7680b58..f31980b 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -771,7 +771,8 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
       return;
    }
    case GL_PROGRAM_SEPARABLE:
-      *params = shProg->SeparateShader;
+      /* If the program has not been linked, return initial value 0. */
+      *params = (shProg->LinkStatus == GL_FALSE) ? 0 : shProg->SeparateShader;
       return;
 
    /* ARB_tessellation_shader */




More information about the mesa-commit mailing list