OSDN Git Service

i965: fix incorrect test for vertex position attribute
authorBrian Paul <brianp@vmware.com>
Tue, 8 Sep 2009 18:21:42 +0000 (12:21 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 8 Sep 2009 18:21:42 +0000 (12:21 -0600)
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_draw_upload.c

index e52fc3f..5cf12fb 100644 (file)
@@ -386,6 +386,8 @@ struct brw_cached_batch_item {
 struct brw_vertex_element {
    const struct gl_client_array *glarray;
 
+   /** The corresponding Mesa vertex attribute */
+   gl_vert_attrib attrib;
    /** Size of a complete element */
    GLuint element_size;
    /** Number of uploaded elements for this input. */
index 5342622..54b0661 100644 (file)
@@ -185,6 +185,7 @@ static void brw_merge_inputs( struct brw_context *brw,
 
    for (i = 0; i < VERT_ATTRIB_MAX; i++) {
       brw->vb.inputs[i].glarray = arrays[i];
+      brw->vb.inputs[i].attrib = (gl_vert_attrib) i;
 
       if (arrays[i]->StrideB != 0)
         brw->vb.info.varying |= 1 << i;
index 05079c0..fd9c391 100644 (file)
@@ -422,7 +422,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
         /* Queue the buffer object up to be uploaded in the next pass,
          * when we've decided if we're doing interleaved or not.
          */
-        if (i == 0) {
+        if (input->attrib == VERT_ATTRIB_POS) {
            /* Position array not properly enabled:
             */
             if (input->glarray->StrideB == 0) {