Mesa (mesa_7_5_branch): i965: fix incorrect test for vertex position attribute

Brian Paul brianp at kemper.freedesktop.org
Tue Sep 8 18:23:18 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 8de625c7cf639c583e8bf43acb1214010989bb64
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8de625c7cf639c583e8bf43acb1214010989bb64

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Sep  8 12:21:42 2009 -0600

i965: fix incorrect test for vertex position attribute

---

 src/mesa/drivers/dri/i965/brw_context.h     |    2 ++
 src/mesa/drivers/dri/i965/brw_draw.c        |    1 +
 src/mesa/drivers/dri/i965/brw_draw_upload.c |    2 +-
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index e52fc3f..5cf12fb 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -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. */
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 5342622..54b0661 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -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;
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 05079c0..fd9c391 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -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) {




More information about the mesa-commit mailing list