diff options
author | Tapani Pälli <[email protected]> | 2014-03-19 10:39:10 +0000 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2014-06-16 06:49:59 +0300 |
commit | 73f7c8636dff34ef4254e0d89fc7670e35a36da9 (patch) | |
tree | 5f802833399ddac0432074e74832cd1b2865ae14 | |
parent | dd2a6519b919395cfb57e0a18be1d7ca858808e2 (diff) |
mesa: support inactive uniforms in glUniform* functions
Support inactive uniforms that have explicit location set in
glUniform* functions.
v2: remove unnecessary extension check, use new define (Ian)
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 5f1af087321..480bc6f163f 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -253,6 +253,21 @@ validate_uniform_parameters(struct gl_context *ctx, return false; } + /* If the driver storage pointer in remap table is -1, we ignore silently. + * + * GL_ARB_explicit_uniform_location spec says: + * "What happens if Uniform* is called with an explicitly defined + * uniform location, but that uniform is deemed inactive by the + * linker? + * + * RESOLVED: The call is ignored for inactive uniform variables and + * no error is generated." + * + */ + if (shProg->UniformRemapTable[location] == + INACTIVE_UNIFORM_EXPLICIT_LOCATION) + return false; + _mesa_uniform_split_location_offset(shProg, location, loc, array_index); if (shProg->UniformStorage[*loc].array_elements == 0 && count > 1) { |