summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nv10_render.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-10-29 21:29:15 +0200
committerFrancisco Jerez <currojerez@riseup.net>2010-10-31 02:45:38 +0200
commit9d1f1fcf136e8f5f427ae203128ff641cc9e7197 (patch)
treefb06f3528ad40c358413b25644b09ef1b7baf035 /src/mesa/drivers/dri/nouveau/nv10_render.c
parentdbe1eae785e8a98eb3d515b572c8e5e28b234edd (diff)
dri/nouveau: Use a macro to iterate over the bound vertex attributes.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv10_render.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_render.c24
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 a03ace3536..3daec613af 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);