st/mesa: move/consolidate an assignment
authorBrian Paul <brianp@vmware.com>
Sun, 16 Jan 2011 00:23:13 +0000 (17:23 -0700)
committerBrian Paul <brianp@vmware.com>
Sun, 16 Jan 2011 00:37:40 +0000 (17:37 -0700)
src/mesa/state_tracker/st_draw.c

index db70daacc484986f57bef208e6a5ce54c7f9f972..b3256a3cb08c76b371436736084c39dc4fb30517 100644 (file)
@@ -440,7 +440,6 @@ setup_non_interleaved_attribs(struct gl_context *ctx,
          vbuffer[attr].buffer = NULL;
          pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer);
          vbuffer[attr].buffer_offset = pointer_to_offset(arrays[mesaAttr]->Ptr);
-         velements[attr].src_offset = 0;
       }
       else {
          /* attribute data is in user-space memory, not a VBO */
@@ -476,7 +475,6 @@ setup_non_interleaved_attribs(struct gl_context *ctx,
          }
 
          vbuffer[attr].buffer_offset = 0;
-         velements[attr].src_offset = 0;
       }
 
       assert(velements[attr].src_offset <= 2048); /* 11-bit field */
@@ -484,6 +482,7 @@ setup_non_interleaved_attribs(struct gl_context *ctx,
       /* common-case setup */
       vbuffer[attr].stride = stride; /* in bytes */
       vbuffer[attr].max_index = max_index;
+      velements[attr].src_offset = 0;
       velements[attr].instance_divisor = 0;
       velements[attr].vertex_buffer_index = attr;
       velements[attr].src_format