summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_vbo.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-02-12 19:18:19 +0100
committerChristoph Bumiller <[email protected]>2011-02-16 15:45:30 +0100
commit17d680cc537acf8a967d9e36f7006afab560122a (patch)
treef884c241b5059046b2a458cfc79e05dabfc43d80 /src/gallium/drivers/nvc0/nvc0_vbo.c
parentbf1ce9c64b3da731bc6073055abc9f3340ac5a17 (diff)
nvc0: force vertex data through FIFO if we need to convert it
We may want to put the converted vertex buffer in persistent storage instead, but these are rare corner cases.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_vbo.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_vbo.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_vbo.c b/src/gallium/drivers/nvc0/nvc0_vbo.c
index fb135725c3f..19fd85273c1 100644
--- a/src/gallium/drivers/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nvc0/nvc0_vbo.c
@@ -60,6 +60,7 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
so->num_elements = num_elements;
so->instance_elts = 0;
so->instance_bufs = 0;
+ so->need_conversion = FALSE;
transkey.nr_elements = 0;
transkey.output_stride = 0;
@@ -83,6 +84,7 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
return NULL;
}
so->element[i].state = nvc0_format_table[fmt].vtx;
+ so->need_conversion = TRUE;
}
so->element[i].state |= i;
@@ -263,7 +265,12 @@ nvc0_vertex_arrays_validate(struct nvc0_context *nvc0)
struct nvc0_vertex_element *ve;
unsigned i;
- nvc0_prevalidate_vbufs(nvc0);
+ if (unlikely(vertex->need_conversion)) {
+ nvc0->vbo_fifo = ~0;
+ nvc0->vbo_user = 0;
+ } else {
+ nvc0_prevalidate_vbufs(nvc0);
+ }
BEGIN_RING(chan, RING_3D(VERTEX_ATTRIB_FORMAT(0)), vertex->num_elements);
for (i = 0; i < vertex->num_elements; ++i) {