mesa: s/primcount/numInstances/
authorBrian Paul <brianp@vmware.com>
Mon, 17 Jan 2011 16:33:47 +0000 (09:33 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 17 Jan 2011 16:33:49 +0000 (09:33 -0700)
primcount is also a parameter to glMultiDrawElements().  Use numInstances
to avoid confusion between these things.

src/mesa/main/api_validate.c
src/mesa/vbo/vbo_exec_array.c

index ac9709db3f1ef1d3cf4beaf78bbfdcef9e7bb998..7c4652f747f8c8963c1c8e41008f4ac0bc742a65 100644 (file)
@@ -329,7 +329,7 @@ _mesa_validate_DrawArrays(struct gl_context *ctx,
 
 GLboolean
 _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint first,
-                                   GLsizei count, GLsizei primcount)
+                                   GLsizei count, GLsizei numInstances)
 {
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
 
@@ -346,10 +346,10 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
       return GL_FALSE;
    }
 
-   if (primcount <= 0) {
-      if (primcount < 0)
+   if (numInstances <= 0) {
+      if (numInstances < 0)
          _mesa_error(ctx, GL_INVALID_VALUE,
-                     "glDrawArraysInstanced(primcount=%d)", primcount);
+                     "glDrawArraysInstanced(numInstances=%d)", numInstances);
       return GL_FALSE;
    }
 
@@ -374,7 +374,7 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
 GLboolean
 _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
                                      GLenum mode, GLsizei count, GLenum type,
-                                     const GLvoid *indices, GLsizei primcount)
+                                     const GLvoid *indices, GLsizei numInstances)
 {
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
 
@@ -399,10 +399,10 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
       return GL_FALSE;
    }
 
-   if (primcount <= 0) {
-      if (primcount < 0)
+   if (numInstances <= 0) {
+      if (numInstances < 0)
          _mesa_error(ctx, GL_INVALID_VALUE,
-                     "glDrawElementsInstanced(primcount=%d)", primcount);
+                     "glDrawElementsInstanced(numInstances=%d)", numInstances);
       return GL_FALSE;
    }
 
index dd36cc32a706fa1e1a4f1c57509960ce8348bdb4..80085c17c5cd13aa4712a6b28935e31d81e65703 100644 (file)
@@ -629,15 +629,15 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
  */
 static void GLAPIENTRY
 vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
-                             GLsizei primcount)
+                             GLsizei numInstances)
 {
    GET_CURRENT_CONTEXT(ctx);
 
    if (MESA_VERBOSE & VERBOSE_DRAW)
       _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
-                  _mesa_lookup_enum_by_nr(mode), start, count, primcount);
+                  _mesa_lookup_enum_by_nr(mode), start, count, numInstances);
 
-   if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, primcount))
+   if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances))
       return;
 
    FLUSH_CURRENT( ctx, 0 );
@@ -649,7 +649,7 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
    if (0)
       check_draw_arrays_data(ctx, start, count);
 
-   vbo_draw_arrays(ctx, mode, start, count, primcount);
+   vbo_draw_arrays(ctx, mode, start, count, numInstances);
 
    if (0)
       print_draw_arrays(ctx, mode, start, count);
@@ -724,7 +724,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
                                GLuint start, GLuint end,
                                GLsizei count, GLenum type,
                                const GLvoid *indices,
-                               GLint basevertex, GLint primcount)
+                               GLint basevertex, GLint numInstances)
 {
    struct vbo_context *vbo = vbo_context(ctx);
    struct vbo_exec_context *exec = &vbo->exec;
@@ -757,7 +757,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
    prim[0].count = count;
    prim[0].indexed = 1;
    prim[0].basevertex = basevertex;
-   prim[0].num_instances = primcount;
+   prim[0].num_instances = numInstances;
 
    /* Need to give special consideration to rendering a range of
     * indices starting somewhere above zero.  Typically the
@@ -977,21 +977,21 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
  */
 static void GLAPIENTRY
 vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
-                               const GLvoid *indices, GLsizei primcount)
+                               const GLvoid *indices, GLsizei numInstances)
 {
    GET_CURRENT_CONTEXT(ctx);
 
    if (MESA_VERBOSE & VERBOSE_DRAW)
       _mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n",
                   _mesa_lookup_enum_by_nr(mode), count,
-                  _mesa_lookup_enum_by_nr(type), indices, primcount);
+                  _mesa_lookup_enum_by_nr(type), indices, numInstances);
 
    if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
-                                             primcount))
+                                             numInstances))
       return;
 
    vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
-                                  count, type, indices, 0, primcount);
+                                  count, type, indices, 0, numInstances);
 }