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.
This commit is contained in:
Christoph Bumiller 2011-02-12 19:18:19 +01:00
parent bf1ce9c64b
commit 17d680cc53
2 changed files with 9 additions and 1 deletions

View file

@ -67,6 +67,7 @@ struct nvc0_vertex_stateobj {
unsigned num_elements;
uint32_t instance_elts;
uint32_t instance_bufs;
boolean need_conversion; /* e.g. VFETCH cannot convert f64 to f32 */
unsigned vtx_size;
unsigned vtx_per_packet_max;
struct nvc0_vertex_element element[0];

View file

@ -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) {