summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40/nv40_vbo.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-04-09 13:58:51 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-04-09 14:02:55 +1000
commitbdfcce47921cdd808740ee26e6781837351bad98 (patch)
tree7b871929331e0e7230baf25fe5ab768bccc7eedc /src/gallium/drivers/nv40/nv40_vbo.c
parent2a8de8ff94e0e0e52e03f8c8427a9e92fae374f4 (diff)
nv40: use vb/ve counts rather than shader inputs for related loops
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_vbo.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_vbo.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/gallium/drivers/nv40/nv40_vbo.c b/src/gallium/drivers/nv40/nv40_vbo.c
index ec88470b31..06374184b1 100644
--- a/src/gallium/drivers/nv40/nv40_vbo.c
+++ b/src/gallium/drivers/nv40/nv40_vbo.c
@@ -481,40 +481,23 @@ nv40_draw_elements(struct pipe_context *pipe,
static boolean
nv40_vbo_validate(struct nv40_context *nv40)
{
- struct nv40_vertex_program *vp = nv40->vertprog;
struct nouveau_stateobj *vtxbuf, *vtxfmt, *sattr = NULL;
struct nouveau_grobj *curie = nv40->screen->curie;
struct pipe_buffer *ib = nv40->idxbuf;
unsigned ib_format = nv40->idxbuf_format;
- unsigned inputs, hw, num_hw;
unsigned vb_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD;
-
- inputs = vp->ir;
- for (hw = 0; hw < 16 && inputs; hw++) {
- if (inputs & (1 << hw)) {
- num_hw = hw;
- inputs &= ~(1 << hw);
- }
- }
- num_hw++;
+ int hw;
vtxbuf = so_new(20, 18);
- so_method(vtxbuf, curie, NV40TCL_VTXBUF_ADDRESS(0), num_hw);
+ so_method(vtxbuf, curie, NV40TCL_VTXBUF_ADDRESS(0), nv40->vtxelt_nr);
vtxfmt = so_new(17, 0);
- so_method(vtxfmt, curie, NV40TCL_VTXFMT(0), num_hw);
+ so_method(vtxfmt, curie, NV40TCL_VTXFMT(0), nv40->vtxelt_nr);
- inputs = vp->ir;
- for (hw = 0; hw < num_hw; hw++) {
+ for (hw = 0; hw < nv40->vtxelt_nr; hw++) {
struct pipe_vertex_element *ve;
struct pipe_vertex_buffer *vb;
unsigned type, ncomp;
- if (!(inputs & (1 << hw))) {
- so_data(vtxbuf, 0);
- so_data(vtxfmt, NV40TCL_VTXFMT_TYPE_FLOAT);
- continue;
- }
-
ve = &nv40->vtxelt[hw];
vb = &nv40->vtxbuf[ve->vertex_buffer_index];