[Mesa-dev] [PATCH 2/3] mesa: return initial value for PROGRAM_SEPARABLE when not linked

Tapani Pälli tapani.palli at intel.com
Tue Sep 1 03:53:43 PDT 2015


I haven't found clear spec evidence of this behaviour but this is
expected by a conformance test that changes the value with
glProgramParameteri but does not link the program. Test says:

"The query for PROGRAM_SEPARABLE must query latched state. In other
words, the state of the binary after it was linked. So in the tests
below, the queries should return the default state GL_FALSE since the
program has no linked binary."

Signed-off-by: Tapani Pälli <tapani.palli 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 0e0e0d6..fb82543 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -773,7 +773,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 */
-- 
2.4.3



More information about the mesa-dev mailing list