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

Lofstedt, Marta marta.lofstedt at intel.com
Fri Sep 11 00:53:19 PDT 2015


Hi Tapani,

For spec. reference I believe you could go for section 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"

and from table 20.20 we see that PROGRAM_SEPARABLE is initialized to FALSE.

You have my R.b if you update.

/Marta
________________________________________
From: mesa-dev [mesa-dev-bounces at lists.freedesktop.org] on behalf of Tapani Pälli [tapani.palli at intel.com]
Sent: Tuesday, September 01, 2015 12:53 PM
To: mesa-dev at lists.freedesktop.org
Cc: Romanick, Ian D
Subject: [Mesa-dev] [PATCH 2/3] mesa: return initial value for  PROGRAM_SEPARABLE when not linked

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

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list