On 05/19/2014 08:09 PM, Ian Romanick wrote:
On 04/09/2014 02:56 AM, Tapani Pälli wrote:
Support inactive uniforms that have explicit location set in
glUniform* functions.

Signed-off-by: Tapani Pälli <tapani.pa...@intel.com>
---
  src/mesa/main/uniform_query.cpp | 15 +++++++++++++++
  1 file changed, 15 insertions(+)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 5f1af08..e33800a 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 (ctx->Extensions.ARB_explicit_uniform_location &&
+      shProg->UniformRemapTable[location] == (gl_uniform_storage *) -1)
+      return false;
+
Do we actually need to check
ctx->Extensions.ARB_explicit_uniform_location?  It seems like
UniformRemapTable will only have -1 in it for that case, right?

Yes, the extension check can be removed.

     _mesa_uniform_split_location_offset(shProg, location, loc, array_index);
if (shProg->UniformStorage[*loc].array_elements == 0 && count > 1) {


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

Reply via email to