}
}
+ /* Section 2.11.7 (Uniform Variables) of the OpenGL 4.2 Core Profile spec
+ * says:
+ *
+ * "If any of the following conditions occur, an INVALID_OPERATION
+ * error is generated by the Uniform* commands, and no uniform values
+ * are changed:
+ *
+ * ...
+ *
+ * - if the uniform declared in the shader is not of type boolean and
+ * the type indicated in the name of the Uniform* command used does
+ * not match the type of the uniform"
+ *
+ * There are no Boolean matrix types, so we do not need to allow
+ * GLSL_TYPE_BOOL here (as _mesa_uniform does).
+ */
+ if (uni->type->base_type != basicType) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUniformMatrix%ux%u(\"%s\"@%d is %s, not %s)",
+ cols, rows, uni->name, location,
+ glsl_type_name(uni->type->base_type),
+ glsl_type_name(basicType));
+ return;
+ }
+
if (unlikely(ctx->_Shader->Flags & GLSL_UNIFORMS)) {
log_uniform(values, uni->type->base_type, components, vectors, count,
bool(transpose), shProg, location, uni);