From: Ian Romanick <ian.d.roman...@intel.com> Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> --- src/mesa/main/uniform_query.cpp | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 50a724b..96de541 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -389,6 +389,8 @@ validate_uniform_parameters(struct gl_context *ctx, * * - if no variable with a location of location exists in the * program object currently in use and location is not -1, + * - if count is greater than one, and the uniform declared in the + * shader is not an array variable, */ if (location < -1) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s(location=%d)", @@ -404,6 +406,13 @@ validate_uniform_parameters(struct gl_context *ctx, return false; } + if (shProg->UniformStorage[*loc].array_elements == 0 && count > 1) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(count > 1 for non-array, location=%d)", + caller, location); + return false; + } + /* This case should be impossible. The implication is that a call like * glGetUniformLocation(prog, "foo[8]") was successful but "foo" is not an * array. -- 1.7.6.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev