u_vbuf: cleanup variable names to be consistent
authorMarek Olšák <maraeo@gmail.com>
Tue, 3 Jan 2012 20:33:55 +0000 (21:33 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 5 Jan 2012 17:29:11 +0000 (18:29 +0100)
src/gallium/auxiliary/util/u_vbuf.c

index 4e94e40269bb96a4ca958c5de8e0c6a96a018fe5..5dfee42bcbda309a9b766a09f686d82fde4622d7 100644 (file)
@@ -164,11 +164,9 @@ void u_vbuf_destroy(struct u_vbuf *mgrb)
 }
 
 static void
-u_vbuf_translate_buffers(struct u_vbuf_priv *mgr,
-                         struct translate_key *key,
-                         unsigned vb_mask,
-                         unsigned out_vb,
-                         int start, unsigned count)
+u_vbuf_translate_buffers(struct u_vbuf_priv *mgr, struct translate_key *key,
+                         unsigned vb_mask, unsigned out_vb,
+                         int start_vertex, unsigned num_vertices)
 {
    struct translate *tr;
    struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS] = {0};
@@ -183,13 +181,13 @@ u_vbuf_translate_buffers(struct u_vbuf_priv *mgr,
    for (i = 0; i < mgr->b.nr_vertex_buffers; i++) {
       if (vb_mask & (1 << i)) {
          struct pipe_vertex_buffer *vb = &mgr->b.vertex_buffer[i];
-         unsigned offset = vb->buffer_offset + vb->stride * start;
+         unsigned offset = vb->buffer_offset + vb->stride * start_vertex;
          uint8_t *map;
 
          if (u_vbuf_resource(vb->buffer)->user_ptr) {
             map = u_vbuf_resource(vb->buffer)->user_ptr + offset;
          } else {
-            unsigned size = vb->stride ? count * vb->stride
+            unsigned size = vb->stride ? num_vertices * vb->stride
                                        : sizeof(double)*4;
 
             if (offset+size > vb->buffer->width0) {
@@ -206,15 +204,15 @@ u_vbuf_translate_buffers(struct u_vbuf_priv *mgr,
 
    /* Create and map the output buffer. */
    u_upload_alloc(mgr->b.uploader,
-                  key->output_stride * start,
-                  key->output_stride * count,
+                  key->output_stride * start_vertex,
+                  key->output_stride * num_vertices,
                   &out_offset, &out_buffer,
                   (void**)&out_map);
 
-   out_offset -= key->output_stride * start;
+   out_offset -= key->output_stride * start_vertex;
 
    /* Translate. */
-   tr->run(tr, 0, count, 0, out_map);
+   tr->run(tr, 0, num_vertices, 0, out_map);
 
    /* Unmap all buffers. */
    for (i = 0; i < mgr->b.nr_vertex_buffers; i++) {
@@ -298,7 +296,7 @@ u_vbuf_translate_begin(struct u_vbuf_priv *mgr,
       0                 /* CONST */
    };
 
-   unsigned count[VB_NUM] = {
+   unsigned num[VB_NUM] = {
       num_vertices,     /* VERTEX */
       num_instances,    /* INSTANCE */
       1                 /* CONST */
@@ -378,7 +376,7 @@ u_vbuf_translate_begin(struct u_vbuf_priv *mgr,
       if (key[type].nr_elements) {
          u_vbuf_translate_buffers(mgr, &key[type], mask[type],
                                   mgr->fallback_vbs[type],
-                                  start[type], count[type]);
+                                  start[type], num[type]);
 
          /* Fixup the stride for constant attribs. */
          if (type == VB_CONST) {