mesa: add KHR_no_error support to glVertexAttribDivisor()
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 4 Apr 2017 05:45:06 +0000 (15:45 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 19 Apr 2017 06:53:25 +0000 (16:53 +1000)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/varray.c

index cf3b18d1f97b7b152b516fd4cc64c7d268cd1253..e1d6bc677f510e106ee93af280432a32a3c4f157 100644 (file)
@@ -1772,15 +1772,17 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
    const GLuint genericIndex = VERT_ATTRIB_GENERIC(index);
    struct gl_vertex_array_object * const vao = ctx->Array.VAO;
 
-   if (!ctx->Extensions.ARB_instanced_arrays) {
-      _mesa_error(ctx, GL_INVALID_OPERATION, "glVertexAttribDivisor()");
-      return;
-   }
+   if (!_mesa_is_no_error_enabled(ctx)) {
+      if (!ctx->Extensions.ARB_instanced_arrays) {
+         _mesa_error(ctx, GL_INVALID_OPERATION, "glVertexAttribDivisor()");
+         return;
+      }
 
-   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribDivisor(index = %u)",
-                  index);
-      return;
+      if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
+         _mesa_error(ctx, GL_INVALID_VALUE,
+                     "glVertexAttribDivisor(index = %u)", index);
+         return;
+      }
    }
 
    assert(genericIndex < ARRAY_SIZE(vao->VertexAttrib));