[Mesa-dev] [PATCH 14/14] mesa: add KHR_no_error support to glVertexAttribDivisor()

Timothy Arceri tarceri at itsqueeze.com
Wed Apr 12 23:42:24 UTC 2017


---
 src/mesa/main/varray.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 3f61608..89a0984 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1782,29 +1782,31 @@ _mesa_PrimitiveRestartIndex(GLuint index)
  * the legacy vertex arrays.
  */
 void GLAPIENTRY
 _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
 {
    GET_CURRENT_CONTEXT(ctx);
 
    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));
 
    /* The ARB_vertex_attrib_binding spec says:
     *
     *    "The command
     *
     *       void VertexAttribDivisor(uint index, uint divisor);
     *
-- 
2.9.3



More information about the mesa-dev mailing list