<div dir="ltr">On 28 August 2013 16:49, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Some drawing functions take a single _mesa_prim object, while others<br>
take an array of primitives.  Both kinds of functions used a parameter<br>
called "prim" (the singular form), which was confusing.<br>
<br>
Using the plural form, "prims," clearly communicates that the parameter<br>
is an array of primitives.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br></blockquote><div><br></div><div>I really like this.  Thanks.<br><br></div><div>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
 src/mesa/drivers/dri/i965/brw_draw.c              | 26 +++++++++++------------<br>
 src/mesa/drivers/dri/i965/brw_draw.h              |  2 +-<br>
 src/mesa/drivers/dri/i965/brw_primitive_restart.c |  8 +++----<br>
 3 files changed, 18 insertions(+), 18 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c<br>
index 2583a6f..d14f7f0 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_draw.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_draw.c<br>
@@ -314,7 +314,7 @@ static void brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)<br>
  */<br>
 static bool brw_try_draw_prims( struct gl_context *ctx,<br>
                                     const struct gl_client_array *arrays[],<br>
-                                    const struct _mesa_prim *prim,<br>
+                                    const struct _mesa_prim *prims,<br>
                                     GLuint nr_prims,<br>
                                     const struct _mesa_index_buffer *ib,<br>
                                     GLuint min_index,<br>
@@ -386,18 +386,18 @@ static bool brw_try_draw_prims( struct gl_context *ctx,<br>
       intel_batchbuffer_require_space(brw, estimated_max_prim_size, false);<br>
       intel_batchbuffer_save_state(brw);<br>
<br>
-      if (brw->num_instances != prim[i].num_instances) {<br>
-         brw->num_instances = prim[i].num_instances;<br>
+      if (brw->num_instances != prims[i].num_instances) {<br>
+         brw->num_instances = prims[i].num_instances;<br>
          brw->state.dirty.brw |= BRW_NEW_VERTICES;<br>
       }<br>
-      if (brw->basevertex != prim[i].basevertex) {<br>
-         brw->basevertex = prim[i].basevertex;<br>
+      if (brw->basevertex != prims[i].basevertex) {<br>
+         brw->basevertex = prims[i].basevertex;<br>
          brw->state.dirty.brw |= BRW_NEW_VERTICES;<br>
       }<br>
       if (brw->gen < 6)<br>
-        brw_set_prim(brw, &prim[i]);<br>
+        brw_set_prim(brw, &prims[i]);<br>
       else<br>
-        gen6_set_prim(brw, &prim[i]);<br>
+        gen6_set_prim(brw, &prims[i]);<br>
<br>
 retry:<br>
       /* Note that before the loop, brw->state.dirty.brw was set to != 0, and<br>
@@ -410,7 +410,7 @@ retry:<br>
         brw_upload_state(brw);<br>
       }<br>
<br>
-      brw_emit_prim(brw, &prim[i], brw->primitive);<br>
+      brw_emit_prim(brw, &prims[i], brw->primitive);<br>
<br>
       brw->no_batch_wrap = false;<br>
<br>
@@ -446,7 +446,7 @@ retry:<br>
 }<br>
<br>
 void brw_draw_prims( struct gl_context *ctx,<br>
-                    const struct _mesa_prim *prim,<br>
+                    const struct _mesa_prim *prims,<br>
                     GLuint nr_prims,<br>
                     const struct _mesa_index_buffer *ib,<br>
                     GLboolean index_bounds_valid,<br>
@@ -461,7 +461,7 @@ void brw_draw_prims( struct gl_context *ctx,<br>
       return;<br>
<br>
    /* Handle primitive restart if needed */<br>
-   if (brw_handle_primitive_restart(ctx, prim, nr_prims, ib)) {<br>
+   if (brw_handle_primitive_restart(ctx, prims, nr_prims, ib)) {<br>
       /* The draw was handled, so we can exit now */<br>
       return;<br>
    }<br>
@@ -471,7 +471,7 @@ void brw_draw_prims( struct gl_context *ctx,<br>
     * to upload.<br>
     */<br>
    if (!vbo_all_varyings_in_vbos(arrays) && !index_bounds_valid)<br>
-      vbo_get_minmax_indices(ctx, prim, ib, &min_index, &max_index, nr_prims);<br>
+      vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index, nr_prims);<br>
<br>
    /* Do GL_SELECT and GL_FEEDBACK rendering using swrast, even though it<br>
     * won't support all the extensions we support.<br>
@@ -481,7 +481,7 @@ void brw_draw_prims( struct gl_context *ctx,<br>
                  _mesa_lookup_enum_by_nr(ctx->RenderMode));<br>
       _swsetup_Wakeup(ctx);<br>
       _tnl_wakeup(ctx);<br>
-      _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);<br>
+      _tnl_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index);<br>
       return;<br>
    }<br>
<br>
@@ -489,7 +489,7 @@ void brw_draw_prims( struct gl_context *ctx,<br>
     * manage it.  swrast doesn't support our featureset, so we can't fall back<br>
     * to it.<br>
     */<br>
-   brw_try_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);<br>
+   brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index);<br>
 }<br>
<br>
 void brw_draw_init( struct brw_context *brw )<br>
diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h<br>
index c915bc3..aac375f 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_draw.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_draw.h<br>
@@ -49,7 +49,7 @@ void brw_draw_destroy( struct brw_context *brw );<br>
 /* brw_primitive_restart.c */<br>
 GLboolean<br>
 brw_handle_primitive_restart(struct gl_context *ctx,<br>
-                             const struct _mesa_prim *prim,<br>
+                             const struct _mesa_prim *prims,<br>
                              GLuint nr_prims,<br>
                              const struct _mesa_index_buffer *ib);<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c b/src/mesa/drivers/dri/i965/brw_primitive_restart.c<br>
index ca2e6b7..27fae8a 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c<br>
@@ -120,7 +120,7 @@ can_cut_index_handle_prims(struct gl_context *ctx,<br>
  */<br>
 GLboolean<br>
 brw_handle_primitive_restart(struct gl_context *ctx,<br>
-                             const struct _mesa_prim *prim,<br>
+                             const struct _mesa_prim *prims,<br>
                              GLuint nr_prims,<br>
                              const struct _mesa_index_buffer *ib)<br>
 {<br>
@@ -158,17 +158,17 @@ brw_handle_primitive_restart(struct gl_context *ctx,<br>
     */<br>
    brw->prim_restart.in_progress = true;<br>
<br>
-   if (can_cut_index_handle_prims(ctx, &prim[0], ib)) {<br>
+   if (can_cut_index_handle_prims(ctx, &prims[0], ib)) {<br>
       /* Cut index should work for primitive restart, so use it<br>
        */<br>
       brw->prim_restart.enable_cut_index = true;<br>
-      brw_draw_prims(ctx, prim, nr_prims, ib, GL_FALSE, -1, -1, NULL);<br>
+      brw_draw_prims(ctx, prims, nr_prims, ib, GL_FALSE, -1, -1, NULL);<br>
       brw->prim_restart.enable_cut_index = false;<br>
    } else {<br>
       /* Not all the primitive draw modes are supported by the cut index,<br>
        * so take the software path<br>
        */<br>
-      vbo_sw_primitive_restart(ctx, prim, nr_prims, ib);<br>
+      vbo_sw_primitive_restart(ctx, prims, nr_prims, ib);<br>
    }<br>
<br>
    brw->prim_restart.in_progress = false;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>