diff options
author | Francisco Jerez <[email protected]> | 2010-10-29 21:29:15 +0200 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2010-10-31 02:45:38 +0200 |
commit | 9d1f1fcf136e8f5f427ae203128ff641cc9e7197 (patch) | |
tree | fb06f3528ad40c358413b25644b09ef1b7baf035 /src/mesa/drivers/dri/nouveau/nv20_render.c | |
parent | dbe1eae785e8a98eb3d515b572c8e5e28b234edd (diff) |
dri/nouveau: Use a macro to iterate over the bound vertex attributes.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv20_render.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv20_render.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv20_render.c b/src/mesa/drivers/dri/nouveau/nv20_render.c index 6b668544627..de62dd5137e 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_render.c +++ b/src/mesa/drivers/dri/nouveau/nv20_render.c @@ -135,11 +135,9 @@ nv20_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 *kelvin = 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]; @@ -164,21 +162,17 @@ nv20_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 *kelvin = 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_mark(bctx, kelvin, - NV20TCL_VTXBUF_ADDRESS(i), - a->bo, a->offset, 0, - 0, NV20TCL_VTXBUF_ADDRESS_DMA1, - NOUVEAU_BO_LOW | NOUVEAU_BO_OR | - NOUVEAU_BO_GART | NOUVEAU_BO_RD); - } + nouveau_bo_mark(bctx, kelvin, + NV20TCL_VTXBUF_ADDRESS(i), + a->bo, a->offset, 0, + 0, NV20TCL_VTXBUF_ADDRESS_DMA1, + NOUVEAU_BO_LOW | NOUVEAU_BO_OR | + NOUVEAU_BO_GART | NOUVEAU_BO_RD); } BEGIN_RING(chan, kelvin, NV20TCL_VTX_CACHE_INVALIDATE, 1); |