From 006c874a0d88735ed09dc763112af77bea47215a Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Wed, 6 May 2015 23:13:41 +0200 Subject: [PATCH 1/2] nv50: fix setting per-instance attribute enables --- src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c index c1590ee..0323da3 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c @@ -296,7 +296,6 @@ nv50_vertex_arrays_validate(struct nv50_context *nv50) struct nv50_vertex_stateobj *vertex = nv50->vertex; struct pipe_vertex_buffer *vb; struct nv50_vertex_element *ve; - uint32_t mask; uint32_t refd = 0; unsigned i; const unsigned n = MAX2(vertex->num_elements, nv50->state.num_vtxelts); @@ -352,10 +351,7 @@ nv50_vertex_arrays_validate(struct nv50_context *nv50) PUSH_DATA(push, NV50_3D_VERTEX_ATTRIB_INACTIVE); /* update per-instance enables */ - mask = vertex->instance_elts ^ nv50->state.instance_elts; - while (mask) { - const int i = ffs(mask) - 1; - mask &= ~(1 << i); + for (i = 0; i < vertex->num_elements; ++i) { BEGIN_NV04(push, NV50_3D(VERTEX_ARRAY_PER_INSTANCE(i)), 1); PUSH_DATA (push, (vertex->instance_elts >> i) & 1); } -- 2.0.5