From 24c98993e595242e68ce2162627277dda8e234a2 Mon Sep 17 00:00:00 2001
From: Fabian Bieler <der.f...@gmx.net>
Date: Thu, 24 Feb 2011 10:56:16 +0100
Subject: [PATCH] gallium/utils: Fix vertex element setup

Check if element was translated per element instead of per buffer.
---
 src/gallium/auxiliary/util/u_vbuf_mgr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c
index 096392f..77aef64 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c
@@ -156,7 +156,7 @@ static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
 {
    struct translate_key key;
    struct translate_element *te;
-   unsigned tr_elem_index[PIPE_MAX_ATTRIBS] = {0};
+   unsigned tr_elem_index[PIPE_MAX_ATTRIBS] = {0xffffffff};
    struct translate *tr;
    boolean vb_translated[PIPE_MAX_ATTRIBS] = {0};
    uint8_t *vb_map[PIPE_MAX_ATTRIBS] = {0}, *out_map;
@@ -281,7 +281,7 @@ static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
 
       /* Setup new vertex elements. */
       for (i = 0; i < mgr->ve->count; i++) {
-         if (vb_translated[mgr->ve->ve[i].vertex_buffer_index]) {
+         if (tr_elem_index[i] < key.nr_elements) {
             te = &key.element[tr_elem_index[i]];
             new_velems[i].instance_divisor = mgr->ve->ve[i].instance_divisor;
             new_velems[i].src_format = te->output_format;
-- 
1.7.2.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to