mesa/varray: make use of dispatch KHR_no_error support
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 27 Apr 2017 04:56:44 +0000 (14:56 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 4 May 2017 01:35:37 +0000 (11:35 +1000)
Make use of dispatch KHR_no_error support for varray functions.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml
src/mapi/glapi/gen/GL3x.xml
src/mapi/glapi/gen/es_EXT.xml
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/varray.c
src/mesa/main/varray.h

index 211642fc317d6bb157a684bd199e25da5421147d..6d76003fec8031d6e624ac14dc4df777c9ba3153 100644 (file)
@@ -51,7 +51,7 @@
         <param name="v" type="const GLdouble *"/>
     </function>
 
-    <function name="VertexAttribLPointer">
+    <function name="VertexAttribLPointer" no_error="true">
         <param name="index" type="GLuint"/>
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
index f38a2876dfeb9e27321cc2d766e0dbb1d0523da8..d2c768dd6fee64172241a787205be9e6f2b1f9b7 100644 (file)
   <!-- These functions alias ones from GL_EXT_gpu_shader4 -->
 
   <function name="VertexAttribIPointer" es2="3.0" marshal="async"
+            no_error="true"
             marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
     <param name="index" type="GLuint"/>
     <param name="size" type="GLint"/>
   <enum name="TEXTURE_SWIZZLE_A"                value="0x8E45"/>
   <enum name="TEXTURE_SWIZZLE_RGBA"             value="0x8E46"/>
 
-  <function name="VertexAttribDivisor" es2="3.0">
+  <function name="VertexAttribDivisor" es2="3.0" no_error="true">
     <param name="index" type="GLuint"/>
     <param name="divisor" type="GLuint"/>
   </function>
index 3e705eb4092f6cd9258f5510b66444393d36e7bd..271f0c09c4c2aaee467c27ebb622a8e3081d2b95 100644 (file)
     <enum name="POINT_SIZE_ARRAY_OES"                     value="0x8B9C"/>
     <enum name="POINT_SIZE_ARRAY_BUFFER_BINDING_OES"     value="0x8B9F"/>
 
-    <function name="PointSizePointerOES" es1="1.0" desktop="false">
+    <function name="PointSizePointerOES" es1="1.0" desktop="false"
+              no_error="true">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
         <param name="pointer" type="const GLvoid *"/>
index d19cfd29e451f2036182d5e31b8e0d980a41d73e..83f4c013ee1d79fd853d11ac99ebb43e47d880df 100644 (file)
     </function>
 
     <function name="ColorPointer" es1="1.0" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
     </function>
 
     <function name="EdgeFlagPointer" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="stride" type="GLsizei"/>
         <param name="pointer" type="const GLvoid *"/>
     </function>
 
     <function name="IndexPointer" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
     </function>
 
     <function name="NormalPointer" es1="1.0" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
     </function>
 
     <function name="TexCoordPointer" es1="1.0" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
     </function>
 
     <function name="VertexPointer" es1="1.0" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
     </function>
 
     <function name="FogCoordPointer" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
     </function>
 
     <function name="SecondaryColorPointer" deprecated="3.1" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
     </function>
 
     <function name="VertexAttribPointer" es2="2.0" marshal="async"
+              no_error="true"
               marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
         <param name="index" type="GLuint"/>
         <param name="size" type="GLint"/>
index 709f6d4ec94df93301611054aaff4e0e304f0404..eda86ec6a823065f4927b7b657106fc724829723 100644 (file)
@@ -577,6 +577,17 @@ update_array(struct gl_context *ctx,
                             effectiveStride);
 }
 
+void GLAPIENTRY
+_mesa_VertexPointer_no_error(GLint size, GLenum type, GLsizei stride,
+                             const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   update_array(ctx, VERT_ATTRIB_POS, GL_RGBA, 4, size, type, stride,
+                GL_FALSE, GL_FALSE, GL_FALSE, ptr);
+}
+
 
 void GLAPIENTRY
 _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
@@ -586,26 +597,35 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      GLbitfield legalTypes = (ctx->API == API_OPENGLES)
-         ? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
-         : (SHORT_BIT | INT_BIT | FLOAT_BIT |
-            DOUBLE_BIT | HALF_BIT |
-            UNSIGNED_INT_2_10_10_10_REV_BIT |
-            INT_2_10_10_10_REV_BIT);
-
-      if (!validate_array_and_format(ctx, "glVertexPointer", VERT_ATTRIB_POS,
-                                     legalTypes, 2, 4, size, type, stride,
-                                     GL_FALSE, GL_FALSE, GL_FALSE, format,
-                                     ptr, ctx->Array.VAO))
-         return;
-   }
+   GLbitfield legalTypes = (ctx->API == API_OPENGLES)
+      ? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
+      : (SHORT_BIT | INT_BIT | FLOAT_BIT |
+         DOUBLE_BIT | HALF_BIT |
+         UNSIGNED_INT_2_10_10_10_REV_BIT |
+         INT_2_10_10_10_REV_BIT);
+
+   if (!validate_array_and_format(ctx, "glVertexPointer", VERT_ATTRIB_POS,
+                                  legalTypes, 2, 4, size, type, stride,
+                                  GL_FALSE, GL_FALSE, GL_FALSE, format,
+                                  ptr, ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_POS, format, 4, size, type, stride,
                 GL_FALSE, GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_NormalPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr )
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   update_array(ctx, VERT_ATTRIB_NORMAL, GL_RGBA, 3, 3, type, stride, GL_TRUE,
+                GL_FALSE, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
 {
@@ -614,26 +634,37 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
-         ? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
-         : (BYTE_BIT | SHORT_BIT | INT_BIT |
-            HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
-            UNSIGNED_INT_2_10_10_10_REV_BIT |
-            INT_2_10_10_10_REV_BIT);
-
-      if (!validate_array_and_format(ctx, "glNormalPointer",
-                                     VERT_ATTRIB_NORMAL, legalTypes, 3, 3, 3,
-                                     type, stride, GL_TRUE, GL_FALSE,
-                                     GL_FALSE, format, ptr, ctx->Array.VAO))
-         return;
-   }
+   const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
+      ? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
+      : (BYTE_BIT | SHORT_BIT | INT_BIT |
+         HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
+         UNSIGNED_INT_2_10_10_10_REV_BIT |
+         INT_2_10_10_10_REV_BIT);
+
+   if (!validate_array_and_format(ctx, "glNormalPointer",
+                                  VERT_ATTRIB_NORMAL, legalTypes, 3, 3, 3,
+                                  type, stride, GL_TRUE, GL_FALSE,
+                                  GL_FALSE, format, ptr, ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_NORMAL, format, 3, 3, type, stride, GL_TRUE,
                 GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_ColorPointer_no_error(GLint size, GLenum type, GLsizei stride,
+                            const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
+   update_array(ctx, VERT_ATTRIB_COLOR0, format, BGRA_OR_4, size,
+                type, stride, GL_TRUE, GL_FALSE, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
 {
@@ -643,29 +674,38 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
-         ? (UNSIGNED_BYTE_BIT | HALF_BIT | FLOAT_BIT | FIXED_ES_BIT)
-         : (BYTE_BIT | UNSIGNED_BYTE_BIT |
-            SHORT_BIT | UNSIGNED_SHORT_BIT |
-            INT_BIT | UNSIGNED_INT_BIT |
-            HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
-            UNSIGNED_INT_2_10_10_10_REV_BIT |
-            INT_2_10_10_10_REV_BIT);
-
-      if (!validate_array_and_format(ctx, "glColorPointer",
-                                     VERT_ATTRIB_COLOR0, legalTypes, sizeMin,
-                                     BGRA_OR_4, size, type, stride, GL_TRUE,
-                                     GL_FALSE, GL_FALSE, format, ptr,
-                                     ctx->Array.VAO))
-         return;
-   }
+   const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
+      ? (UNSIGNED_BYTE_BIT | HALF_BIT | FLOAT_BIT | FIXED_ES_BIT)
+      : (BYTE_BIT | UNSIGNED_BYTE_BIT |
+         SHORT_BIT | UNSIGNED_SHORT_BIT |
+         INT_BIT | UNSIGNED_INT_BIT |
+         HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
+         UNSIGNED_INT_2_10_10_10_REV_BIT |
+         INT_2_10_10_10_REV_BIT);
+
+   if (!validate_array_and_format(ctx, "glColorPointer",
+                                  VERT_ATTRIB_COLOR0, legalTypes, sizeMin,
+                                  BGRA_OR_4, size, type, stride, GL_TRUE,
+                                  GL_FALSE, GL_FALSE, format, ptr,
+                                  ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_COLOR0, format, BGRA_OR_4, size,
                 type, stride, GL_TRUE, GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_FogCoordPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   update_array(ctx, VERT_ATTRIB_FOG, GL_RGBA, 1, 1, type, stride, GL_FALSE,
+                GL_FALSE, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_FogCoordPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
 {
@@ -674,21 +714,30 @@ _mesa_FogCoordPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      const GLbitfield legalTypes = (HALF_BIT | FLOAT_BIT | DOUBLE_BIT);
+   const GLbitfield legalTypes = (HALF_BIT | FLOAT_BIT | DOUBLE_BIT);
 
-      if (!validate_array_and_format(ctx, "glFogCoordPointer",
-                                     VERT_ATTRIB_FOG, legalTypes, 1, 1, 1,
-                                     type, stride, GL_FALSE, GL_FALSE,
-                                     GL_FALSE, format, ptr, ctx->Array.VAO))
-         return;
-   }
+   if (!validate_array_and_format(ctx, "glFogCoordPointer",
+                                  VERT_ATTRIB_FOG, legalTypes, 1, 1, 1,
+                                  type, stride, GL_FALSE, GL_FALSE,
+                                  GL_FALSE, format, ptr, ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_FOG, format, 1, 1, type, stride, GL_FALSE,
                 GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_IndexPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   update_array(ctx, VERT_ATTRIB_COLOR_INDEX, GL_RGBA, 1, 1, type, stride,
+                GL_FALSE, GL_FALSE, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
 {
@@ -697,23 +746,34 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      const GLbitfield legalTypes = (UNSIGNED_BYTE_BIT | SHORT_BIT | INT_BIT |
+   const GLbitfield legalTypes = (UNSIGNED_BYTE_BIT | SHORT_BIT | INT_BIT |
                                      FLOAT_BIT | DOUBLE_BIT);
 
-      if (!validate_array_and_format(ctx, "glIndexPointer",
-                                     VERT_ATTRIB_COLOR_INDEX,
-                                     legalTypes, 1, 1, 1, type, stride,
-                                     GL_FALSE, GL_FALSE, GL_FALSE, format,
-                                     ptr, ctx->Array.VAO))
-         return;
-   }
+   if (!validate_array_and_format(ctx, "glIndexPointer",
+                                  VERT_ATTRIB_COLOR_INDEX,
+                                  legalTypes, 1, 1, 1, type, stride,
+                                  GL_FALSE, GL_FALSE, GL_FALSE, format,
+                                  ptr, ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_COLOR_INDEX, format, 1, 1, type, stride,
                 GL_FALSE, GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_SecondaryColorPointer_no_error(GLint size, GLenum type,
+                                     GLsizei stride, const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
+   update_array(ctx, VERT_ATTRIB_COLOR1, format, BGRA_OR_4, size, type,
+                stride, GL_TRUE, GL_FALSE, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_SecondaryColorPointer(GLint size, GLenum type,
                               GLsizei stride, const GLvoid *ptr)
@@ -723,27 +783,38 @@ _mesa_SecondaryColorPointer(GLint size, GLenum type,
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
-                                     SHORT_BIT | UNSIGNED_SHORT_BIT |
-                                     INT_BIT | UNSIGNED_INT_BIT |
-                                     HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
-                                     UNSIGNED_INT_2_10_10_10_REV_BIT |
-                                     INT_2_10_10_10_REV_BIT);
-
-      if (!validate_array_and_format(ctx, "glSecondaryColorPointer",
-                                     VERT_ATTRIB_COLOR1, legalTypes, 3,
-                                     BGRA_OR_4, size, type, stride,
-                                     GL_TRUE, GL_FALSE, GL_FALSE, format, ptr,
-                                     ctx->Array.VAO))
-         return;
-   }
+   const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
+                                  SHORT_BIT | UNSIGNED_SHORT_BIT |
+                                  INT_BIT | UNSIGNED_INT_BIT |
+                                  HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
+                                  UNSIGNED_INT_2_10_10_10_REV_BIT |
+                                  INT_2_10_10_10_REV_BIT);
+
+   if (!validate_array_and_format(ctx, "glSecondaryColorPointer",
+                                  VERT_ATTRIB_COLOR1, legalTypes, 3,
+                                  BGRA_OR_4, size, type, stride,
+                                  GL_TRUE, GL_FALSE, GL_FALSE, format, ptr,
+                                  ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_COLOR1, format, BGRA_OR_4, size, type,
                 stride, GL_TRUE, GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_TexCoordPointer_no_error(GLint size, GLenum type, GLsizei stride,
+                               const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   const GLuint unit = ctx->Array.ActiveTexture;
+   FLUSH_VERTICES(ctx, 0);
+
+   update_array(ctx, VERT_ATTRIB_TEX(unit), GL_RGBA, 4, size, type,
+                stride, GL_FALSE, GL_FALSE, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
                       const GLvoid *ptr)
@@ -755,27 +826,38 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
-         ? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
-         : (SHORT_BIT | INT_BIT |
-            HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
-            UNSIGNED_INT_2_10_10_10_REV_BIT |
-            INT_2_10_10_10_REV_BIT);
-
-      if (!validate_array_and_format(ctx, "glTexCoordPointer",
-                                     VERT_ATTRIB_TEX(unit), legalTypes,
-                                     sizeMin, 4, size, type, stride,
-                                     GL_FALSE, GL_FALSE, GL_FALSE, format, ptr,
-                                     ctx->Array.VAO))
-         return;
-   }
+   const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
+      ? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
+      : (SHORT_BIT | INT_BIT |
+         HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
+         UNSIGNED_INT_2_10_10_10_REV_BIT |
+         INT_2_10_10_10_REV_BIT);
+
+   if (!validate_array_and_format(ctx, "glTexCoordPointer",
+                                  VERT_ATTRIB_TEX(unit), legalTypes,
+                                  sizeMin, 4, size, type, stride,
+                                  GL_FALSE, GL_FALSE, GL_FALSE, format, ptr,
+                                  ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_TEX(unit), format, 4, size, type,
                 stride, GL_FALSE, GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_EdgeFlagPointer_no_error(GLsizei stride, const GLvoid *ptr)
+{
+   /* this is the same type that glEdgeFlag uses */
+   const GLboolean integer = GL_FALSE;
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   update_array(ctx, VERT_ATTRIB_EDGEFLAG, GL_RGBA, 1, 1, GL_UNSIGNED_BYTE,
+                stride, GL_FALSE, integer, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr)
 {
@@ -786,22 +868,32 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr)
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      const GLbitfield legalTypes = UNSIGNED_BYTE_BIT;
+   const GLbitfield legalTypes = UNSIGNED_BYTE_BIT;
 
-      if (!validate_array_and_format(ctx, "glEdgeFlagPointer",
-                                     VERT_ATTRIB_EDGEFLAG, legalTypes,
-                                     1, 1, 1, GL_UNSIGNED_BYTE, stride,
-                                     GL_FALSE, integer, GL_FALSE, format, ptr,
-                                     ctx->Array.VAO))
-         return;
-   }
+   if (!validate_array_and_format(ctx, "glEdgeFlagPointer",
+                                  VERT_ATTRIB_EDGEFLAG, legalTypes,
+                                  1, 1, 1, GL_UNSIGNED_BYTE, stride,
+                                  GL_FALSE, integer, GL_FALSE, format, ptr,
+                                  ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_EDGEFLAG, format, 1, 1, GL_UNSIGNED_BYTE,
                 stride, GL_FALSE, integer, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_PointSizePointerOES_no_error(GLenum type, GLsizei stride,
+                                   const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+
+   update_array(ctx, VERT_ATTRIB_POINT_SIZE, GL_RGBA, 1, 1, type, stride,
+                GL_FALSE, GL_FALSE, GL_FALSE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_PointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *ptr)
 {
@@ -810,27 +902,38 @@ _mesa_PointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *ptr)
    FLUSH_VERTICES(ctx, 0);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      if (ctx->API != API_OPENGLES) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glPointSizePointer(ES 1.x only)");
-         return;
-      }
+   if (ctx->API != API_OPENGLES) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glPointSizePointer(ES 1.x only)");
+      return;
+   }
 
-      const GLbitfield legalTypes = (FLOAT_BIT | FIXED_ES_BIT);
+   const GLbitfield legalTypes = (FLOAT_BIT | FIXED_ES_BIT);
 
-      if (!validate_array_and_format(ctx, "glPointSizePointer",
-                                     VERT_ATTRIB_POINT_SIZE, legalTypes,
-                                     1, 1, 1, type, stride, GL_FALSE, GL_FALSE,
-                                     GL_FALSE, format, ptr, ctx->Array.VAO))
-         return;
-   }
+   if (!validate_array_and_format(ctx, "glPointSizePointer",
+                                  VERT_ATTRIB_POINT_SIZE, legalTypes,
+                                  1, 1, 1, type, stride, GL_FALSE, GL_FALSE,
+                                  GL_FALSE, format, ptr, ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_POINT_SIZE, format, 1, 1, type, stride,
                 GL_FALSE, GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_VertexAttribPointer_no_error(GLuint index, GLint size, GLenum type,
+                                   GLboolean normalized,
+                                   GLsizei stride, const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
+   update_array(ctx, VERT_ATTRIB_GENERIC(index), format, BGRA_OR_4,
+                size, type, stride, normalized, GL_FALSE, GL_FALSE, ptr);
+}
+
+
 /**
  * Set a generic vertex attribute array.
  * Note that these arrays DO NOT alias the conventional GL vertex arrays
@@ -844,34 +947,45 @@ _mesa_VertexAttribPointer(GLuint index, GLint size, GLenum type,
    GET_CURRENT_CONTEXT(ctx);
 
    GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
-         _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(idx)");
-         return;
-      }
-
-      const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
-                                     SHORT_BIT | UNSIGNED_SHORT_BIT |
-                                     INT_BIT | UNSIGNED_INT_BIT |
-                                     HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
-                                     FIXED_ES_BIT | FIXED_GL_BIT |
-                                     UNSIGNED_INT_2_10_10_10_REV_BIT |
-                                     INT_2_10_10_10_REV_BIT |
-                                     UNSIGNED_INT_10F_11F_11F_REV_BIT);
-
-      if (!validate_array_and_format(ctx, "glVertexAttribPointer",
-                                     VERT_ATTRIB_GENERIC(index), legalTypes,
-                                     1, BGRA_OR_4, size, type, stride,
-                                     normalized, GL_FALSE, GL_FALSE, format,
-                                     ptr, ctx->Array.VAO))
-         return;
+   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(idx)");
+      return;
    }
 
+   const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
+                                  SHORT_BIT | UNSIGNED_SHORT_BIT |
+                                  INT_BIT | UNSIGNED_INT_BIT |
+                                  HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
+                                  FIXED_ES_BIT | FIXED_GL_BIT |
+                                  UNSIGNED_INT_2_10_10_10_REV_BIT |
+                                  INT_2_10_10_10_REV_BIT |
+                                  UNSIGNED_INT_10F_11F_11F_REV_BIT);
+
+   if (!validate_array_and_format(ctx, "glVertexAttribPointer",
+                                  VERT_ATTRIB_GENERIC(index), legalTypes,
+                                  1, BGRA_OR_4, size, type, stride,
+                                  normalized, GL_FALSE, GL_FALSE, format,
+                                  ptr, ctx->Array.VAO))
+      return;
+
    update_array(ctx, VERT_ATTRIB_GENERIC(index), format, BGRA_OR_4,
                 size, type, stride, normalized, GL_FALSE, GL_FALSE, ptr);
 }
 
 
+void GLAPIENTRY
+_mesa_VertexAttribIPointer_no_error(GLuint index, GLint size, GLenum type,
+                                    GLsizei stride, const GLvoid *ptr)
+{
+   const GLboolean normalized = GL_FALSE;
+   const GLboolean integer = GL_TRUE;
+   GET_CURRENT_CONTEXT(ctx);
+
+   update_array(ctx, VERT_ATTRIB_GENERIC(index), GL_RGBA, 4,  size, type,
+                stride, normalized, integer, GL_FALSE, ptr);
+}
+
+
 /**
  * GL_EXT_gpu_shader4 / GL 3.0.
  * Set an integer-valued vertex attribute array.
@@ -887,28 +1001,38 @@ _mesa_VertexAttribIPointer(GLuint index, GLint size, GLenum type,
    GET_CURRENT_CONTEXT(ctx);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
-         _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribIPointer(index)");
-         return;
-      }
+   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribIPointer(index)");
+      return;
+   }
 
-      const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
-                                     SHORT_BIT | UNSIGNED_SHORT_BIT |
-                                     INT_BIT | UNSIGNED_INT_BIT);
+   const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
+                                  SHORT_BIT | UNSIGNED_SHORT_BIT |
+                                  INT_BIT | UNSIGNED_INT_BIT);
 
-      if (!validate_array_and_format(ctx, "glVertexAttribIPointer",
-                                     VERT_ATTRIB_GENERIC(index), legalTypes,
-                                     1, 4, size, type, stride,
-                                     normalized, integer, GL_FALSE, format,
-                                     ptr, ctx->Array.VAO))
-         return;
-   }
+   if (!validate_array_and_format(ctx, "glVertexAttribIPointer",
+                                  VERT_ATTRIB_GENERIC(index), legalTypes,
+                                  1, 4, size, type, stride,
+                                  normalized, integer, GL_FALSE, format,
+                                  ptr, ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_GENERIC(index), format, 4,  size, type,
                 stride, normalized, integer, GL_FALSE, ptr);
 }
 
+
+void GLAPIENTRY
+_mesa_VertexAttribLPointer_no_error(GLuint index, GLint size, GLenum type,
+                                    GLsizei stride, const GLvoid *ptr)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   update_array(ctx, VERT_ATTRIB_GENERIC(index), GL_RGBA, 4, size, type,
+                stride, GL_FALSE, GL_FALSE, GL_TRUE, ptr);
+}
+
+
 void GLAPIENTRY
 _mesa_VertexAttribLPointer(GLuint index, GLint size, GLenum type,
                            GLsizei stride, const GLvoid *ptr)
@@ -916,21 +1040,19 @@ _mesa_VertexAttribLPointer(GLuint index, GLint size, GLenum type,
    GET_CURRENT_CONTEXT(ctx);
 
    GLenum format = GL_RGBA;
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
-         _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribLPointer(index)");
-         return;
-      }
+   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribLPointer(index)");
+      return;
+   }
 
-      const GLbitfield legalTypes = DOUBLE_BIT;
+   const GLbitfield legalTypes = DOUBLE_BIT;
 
-      if (!validate_array_and_format(ctx, "glVertexAttribLPointer",
-                                     VERT_ATTRIB_GENERIC(index), legalTypes,
-                                     1, 4, size, type, stride,
-                                     GL_FALSE, GL_FALSE, GL_TRUE, format,
-                                     ptr, ctx->Array.VAO))
-         return;
-   }
+   if (!validate_array_and_format(ctx, "glVertexAttribLPointer",
+                                  VERT_ATTRIB_GENERIC(index), legalTypes,
+                                  1, 4, size, type, stride,
+                                  GL_FALSE, GL_FALSE, GL_TRUE, format,
+                                  ptr, ctx->Array.VAO))
+      return;
 
    update_array(ctx, VERT_ATTRIB_GENERIC(index), format, 4, size, type,
                 stride, GL_FALSE, GL_FALSE, GL_TRUE, ptr);
@@ -1759,6 +1881,32 @@ _mesa_PrimitiveRestartIndex(GLuint index)
 }
 
 
+void GLAPIENTRY
+_mesa_VertexAttribDivisor_no_error(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;
+
+   assert(genericIndex < ARRAY_SIZE(vao->VertexAttrib));
+
+   /* The ARB_vertex_attrib_binding spec says:
+    *
+    *    "The command
+    *
+    *       void VertexAttribDivisor(uint index, uint divisor);
+    *
+    *     is equivalent to (assuming no errors are generated):
+    *
+    *       VertexAttribBinding(index, index);
+    *       VertexBindingDivisor(index, divisor);"
+    */
+   vertex_attrib_binding(ctx, vao, genericIndex, genericIndex);
+   vertex_binding_divisor(ctx, vao, genericIndex, divisor);
+}
+
+
 /**
  * See GL_ARB_instanced_arrays.
  * Note that the instance divisor only applies to generic arrays, not
@@ -1772,17 +1920,15 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
    const GLuint genericIndex = VERT_ATTRIB_GENERIC(index);
    struct gl_vertex_array_object * const vao = ctx->Array.VAO;
 
-   if (!_mesa_is_no_error_enabled(ctx)) {
-      if (!ctx->Extensions.ARB_instanced_arrays) {
-         _mesa_error(ctx, GL_INVALID_OPERATION, "glVertexAttribDivisor()");
-         return;
-      }
+   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));
index d274ec55fe7be68b016127383b4059440b064e8c..ac49434ab900ec816d02792d0b1f83540229b1c3 100644 (file)
@@ -109,27 +109,40 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
                          GLintptr offset, GLsizei stride);
 
 extern void GLAPIENTRY
+_mesa_VertexPointer_no_error(GLint size, GLenum type, GLsizei stride,
+                             const GLvoid *ptr);
+extern void GLAPIENTRY
 _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride,
                     const GLvoid *ptr);
 
-
+extern void GLAPIENTRY
+_mesa_NormalPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
 
-
+extern void GLAPIENTRY
+_mesa_ColorPointer_no_error(GLint size, GLenum type, GLsizei stride,
+                            const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
 
 
+extern void GLAPIENTRY
+_mesa_IndexPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
 
 
+extern void GLAPIENTRY
+_mesa_TexCoordPointer_no_error(GLint size, GLenum type, GLsizei stride,
+                               const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
                       const GLvoid *ptr);
 
 
+extern void GLAPIENTRY
+_mesa_EdgeFlagPointer_no_error(GLsizei stride, const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr);
 
@@ -162,30 +175,48 @@ _mesa_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
 extern void GLAPIENTRY
 _mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr);
 
-
+extern void GLAPIENTRY
+_mesa_FogCoordPointer_no_error(GLenum type, GLsizei stride,
+                               const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_FogCoordPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
 
 
+extern void GLAPIENTRY
+_mesa_SecondaryColorPointer_no_error(GLint size, GLenum type,
+                                     GLsizei stride, const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_SecondaryColorPointer(GLint size, GLenum type,
                               GLsizei stride, const GLvoid *ptr);
 
 
+extern void GLAPIENTRY
+_mesa_PointSizePointerOES_no_error(GLenum type, GLsizei stride,
+                                   const GLvoid *ptr);
 extern void GLAPIENTRY
 _mesa_PointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *ptr);
 
 
+extern void GLAPIENTRY
+_mesa_VertexAttribPointer_no_error(GLuint index, GLint size, GLenum type,
+                                   GLboolean normalized, GLsizei stride,
+                                   const GLvoid *pointer);
 extern void GLAPIENTRY
 _mesa_VertexAttribPointer(GLuint index, GLint size, GLenum type,
                              GLboolean normalized, GLsizei stride,
                              const GLvoid *pointer);
 
 void GLAPIENTRY
+_mesa_VertexAttribIPointer_no_error(GLuint index, GLint size, GLenum type,
+                                    GLsizei stride, const GLvoid *ptr);
+void GLAPIENTRY
 _mesa_VertexAttribIPointer(GLuint index, GLint size, GLenum type,
                            GLsizei stride, const GLvoid *ptr);
 
 extern void GLAPIENTRY
+_mesa_VertexAttribLPointer_no_error(GLuint index, GLint size, GLenum type,
+                                    GLsizei stride, const GLvoid *pointer);
+extern void GLAPIENTRY
 _mesa_VertexAttribLPointer(GLuint index, GLint size, GLenum type,
                            GLsizei stride, const GLvoid *pointer);
 
@@ -307,7 +338,8 @@ _mesa_DrawTransformFeedback(GLenum mode, GLuint name);
 extern void GLAPIENTRY
 _mesa_PrimitiveRestartIndex(GLuint index);
 
-
+extern void GLAPIENTRY
+_mesa_VertexAttribDivisor_no_error(GLuint index, GLuint divisor);
 extern void GLAPIENTRY
 _mesa_VertexAttribDivisor(GLuint index, GLuint divisor);