summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_state.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2012-05-16 21:08:37 +0200
committerChristoph Bumiller <[email protected]>2012-05-17 15:24:58 +0200
commite6caafd9d7fbfcb5906d22be9d6a3c1714e078ac (patch)
tree3e933ed79288c21fa45d3ce697ea5ca8196ee9f5 /src/gallium/drivers/nv50/nv50_state.c
parentef7bb281292c17b762b57779306e874704c87328 (diff)
nv50,nvc0: handle user vertex buffers
And restructure VBO validation a little in the process.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_state.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c
index 1e7d17a7197..81c3fa24ab0 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -889,12 +889,23 @@ nv50_set_vertex_buffers(struct pipe_context *pipe,
struct nv50_context *nv50 = nv50_context(pipe);
unsigned i;
- for (i = 0; i < count; ++i)
+ nv50->vbo_user = nv50->vbo_constant = 0;
+
+ for (i = 0; i < count; ++i) {
+ nv50->vtxbuf[i].stride = vb[i].stride;
pipe_resource_reference(&nv50->vtxbuf[i].buffer, vb[i].buffer);
+ if (!vb[i].buffer && vb[i].user_buffer) {
+ nv50->vtxbuf[i].user_buffer = vb[i].user_buffer;
+ nv50->vbo_user |= 1 << i;
+ if (!vb[i].stride)
+ nv50->vbo_constant |= 1 << i;
+ } else {
+ nv50->vtxbuf[i].buffer_offset = vb[i].buffer_offset;
+ }
+ }
for (; i < nv50->num_vtxbufs; ++i)
pipe_resource_reference(&nv50->vtxbuf[i].buffer, NULL);
- memcpy(nv50->vtxbuf, vb, sizeof(*vb) * count);
nv50->num_vtxbufs = count;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_VERTEX);