i965: Rename "prim" parameter to "prims" where it's an array.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 28 Aug 2013 21:59:03 +0000 (14:59 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 3 Sep 2013 18:29:33 +0000 (11:29 -0700)
Some drawing functions take a single _mesa_prim object, while others
take an array of primitives.  Both kinds of functions used a parameter
called "prim" (the singular form), which was confusing.

Using the plural form, "prims," clearly communicates that the parameter
is an array of primitives.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_draw.h
src/mesa/drivers/dri/i965/brw_primitive_restart.c

index dec17db87d17ad343f97e6ff51695f349d9acc01..37f5e3867e6d53ea6e681df85593b0a3a22d6395 100644 (file)
@@ -315,7 +315,7 @@ static void brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
  */
 static bool brw_try_draw_prims( struct gl_context *ctx,
                                     const struct gl_client_array *arrays[],
-                                    const struct _mesa_prim *prim,
+                                    const struct _mesa_prim *prims,
                                     GLuint nr_prims,
                                     const struct _mesa_index_buffer *ib,
                                     GLuint min_index,
@@ -390,18 +390,18 @@ static bool brw_try_draw_prims( struct gl_context *ctx,
       intel_batchbuffer_require_space(brw, estimated_max_prim_size, false);
       intel_batchbuffer_save_state(brw);
 
-      if (brw->num_instances != prim[i].num_instances) {
-         brw->num_instances = prim[i].num_instances;
+      if (brw->num_instances != prims[i].num_instances) {
+         brw->num_instances = prims[i].num_instances;
          brw->state.dirty.brw |= BRW_NEW_VERTICES;
       }
-      if (brw->basevertex != prim[i].basevertex) {
-         brw->basevertex = prim[i].basevertex;
+      if (brw->basevertex != prims[i].basevertex) {
+         brw->basevertex = prims[i].basevertex;
          brw->state.dirty.brw |= BRW_NEW_VERTICES;
       }
       if (brw->gen < 6)
-        brw_set_prim(brw, &prim[i]);
+        brw_set_prim(brw, &prims[i]);
       else
-        gen6_set_prim(brw, &prim[i]);
+        gen6_set_prim(brw, &prims[i]);
 
 retry:
       /* Note that before the loop, brw->state.dirty.brw was set to != 0, and
@@ -414,7 +414,7 @@ retry:
         brw_upload_state(brw);
       }
 
-      brw_emit_prim(brw, &prim[i], brw->primitive);
+      brw_emit_prim(brw, &prims[i], brw->primitive);
 
       brw->no_batch_wrap = false;
 
@@ -450,7 +450,7 @@ retry:
 }
 
 void brw_draw_prims( struct gl_context *ctx,
-                    const struct _mesa_prim *prim,
+                    const struct _mesa_prim *prims,
                     GLuint nr_prims,
                     const struct _mesa_index_buffer *ib,
                     GLboolean index_bounds_valid,
@@ -465,7 +465,7 @@ void brw_draw_prims( struct gl_context *ctx,
       return;
 
    /* Handle primitive restart if needed */
-   if (brw_handle_primitive_restart(ctx, prim, nr_prims, ib)) {
+   if (brw_handle_primitive_restart(ctx, prims, nr_prims, ib)) {
       /* The draw was handled, so we can exit now */
       return;
    }
@@ -475,7 +475,7 @@ void brw_draw_prims( struct gl_context *ctx,
     * to upload.
     */
    if (!vbo_all_varyings_in_vbos(arrays) && !index_bounds_valid)
-      vbo_get_minmax_indices(ctx, prim, ib, &min_index, &max_index, nr_prims);
+      vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index, nr_prims);
 
    /* Do GL_SELECT and GL_FEEDBACK rendering using swrast, even though it
     * won't support all the extensions we support.
@@ -485,7 +485,7 @@ void brw_draw_prims( struct gl_context *ctx,
                  _mesa_lookup_enum_by_nr(ctx->RenderMode));
       _swsetup_Wakeup(ctx);
       _tnl_wakeup(ctx);
-      _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
+      _tnl_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index);
       return;
    }
 
@@ -493,7 +493,7 @@ void brw_draw_prims( struct gl_context *ctx,
     * manage it.  swrast doesn't support our featureset, so we can't fall back
     * to it.
     */
-   brw_try_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
+   brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index);
 }
 
 void brw_draw_init( struct brw_context *brw )
index c915bc37db241ed3df01c24038f360b9a0159be7..aac375f8a87c492833d1d7f0a0f0f005c6933c8b 100644 (file)
@@ -49,7 +49,7 @@ void brw_draw_destroy( struct brw_context *brw );
 /* brw_primitive_restart.c */
 GLboolean
 brw_handle_primitive_restart(struct gl_context *ctx,
-                             const struct _mesa_prim *prim,
+                             const struct _mesa_prim *prims,
                              GLuint nr_prims,
                              const struct _mesa_index_buffer *ib);
 
index b305dca57bbf988042916047b12bdf24c9d2c714..bd48762c200a9e763f0aaff4885ef25f021a96e7 100644 (file)
@@ -123,7 +123,7 @@ can_cut_index_handle_prims(struct gl_context *ctx,
  */
 GLboolean
 brw_handle_primitive_restart(struct gl_context *ctx,
-                             const struct _mesa_prim *prim,
+                             const struct _mesa_prim *prims,
                              GLuint nr_prims,
                              const struct _mesa_index_buffer *ib)
 {
@@ -161,17 +161,17 @@ brw_handle_primitive_restart(struct gl_context *ctx,
     */
    brw->prim_restart.in_progress = true;
 
-   if (can_cut_index_handle_prims(ctx, prim, nr_prims, ib)) {
+   if (can_cut_index_handle_prims(ctx, prims, nr_prims, ib)) {
       /* Cut index should work for primitive restart, so use it
        */
       brw->prim_restart.enable_cut_index = true;
-      brw_draw_prims(ctx, prim, nr_prims, ib, GL_FALSE, -1, -1, NULL);
+      brw_draw_prims(ctx, prims, nr_prims, ib, GL_FALSE, -1, -1, NULL);
       brw->prim_restart.enable_cut_index = false;
    } else {
       /* Not all the primitive draw modes are supported by the cut index,
        * so take the software path
        */
-      vbo_sw_primitive_restart(ctx, prim, nr_prims, ib);
+      vbo_sw_primitive_restart(ctx, prims, nr_prims, ib);
    }
 
    brw->prim_restart.in_progress = false;