diff options
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv10_render.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_render.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_render.c b/src/mesa/drivers/dri/nouveau/nv10_render.c index a03ace35366..3daec613af5 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_render.c +++ b/src/mesa/drivers/dri/nouveau/nv10_render.c @@ -111,11 +111,9 @@ nv10_render_set_format(struct gl_context *ctx) struct nouveau_render_state *render = to_render_state(ctx); struct nouveau_channel *chan = context_chan(ctx); struct nouveau_grobj *celsius = context_eng3d(ctx); - int i, hw_format; - - for (i = 0; i < NUM_VERTEX_ATTRS; i++) { - int attr = render->map[i]; + int i, attr, hw_format; + FOR_EACH_ATTR(render, i, attr) { if (attr >= 0) { struct nouveau_array_state *a = &render->attrs[attr]; @@ -142,19 +140,15 @@ nv10_render_bind_vertices(struct gl_context *ctx) struct nouveau_bo_context *bctx = context_bctx(ctx, VERTEX); struct nouveau_channel *chan = context_chan(ctx); struct nouveau_grobj *celsius = context_eng3d(ctx); - int i; + int i, attr; - for (i = 0; i < NUM_VERTEX_ATTRS; i++) { - int attr = render->map[i]; + FOR_EACH_BOUND_ATTR(render, i, attr) { + struct nouveau_array_state *a = &render->attrs[attr]; - if (attr >= 0) { - struct nouveau_array_state *a = &render->attrs[attr]; - - nouveau_bo_markl(bctx, celsius, - NV10TCL_VTXBUF_ADDRESS(i), - a->bo, a->offset, - NOUVEAU_BO_GART | NOUVEAU_BO_RD); - } + nouveau_bo_markl(bctx, celsius, + NV10TCL_VTXBUF_ADDRESS(i), + a->bo, a->offset, + NOUVEAU_BO_GART | NOUVEAU_BO_RD); } BEGIN_RING(chan, celsius, NV10TCL_VERTEX_ARRAY_VALIDATE, 1); |