summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_vbo_translate.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/nvc0/nvc0_vbo_translate.c
parentef7bb281292c17b762b57779306e874704c87328 (diff)
nv50,nvc0: handle user vertex buffers
And restructure VBO validation a little in the process.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_vbo_translate.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_vbo_translate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_vbo_translate.c b/src/gallium/drivers/nvc0/nvc0_vbo_translate.c
index 6317c21a8d7..42d9e055c71 100644
--- a/src/gallium/drivers/nvc0/nvc0_vbo_translate.c
+++ b/src/gallium/drivers/nvc0/nvc0_vbo_translate.c
@@ -65,8 +65,11 @@ nvc0_vertex_configure_translate(struct nvc0_context *nvc0, int32_t index_bias)
const uint8_t *map;
const struct pipe_vertex_buffer *vb = &nvc0->vtxbuf[i];
- map = nouveau_resource_map_offset(&nvc0->base,
- nv04_resource(vb->buffer), vb->buffer_offset, NOUVEAU_BO_RD);
+ if (likely(!vb->buffer))
+ map = (const uint8_t *)vb->user_buffer;
+ else
+ map = nouveau_resource_map_offset(&nvc0->base,
+ nv04_resource(vb->buffer), vb->buffer_offset, NOUVEAU_BO_RD);
if (index_bias && !unlikely(nvc0->vertex->instance_bufs & (1 << i)))
map += (intptr_t)index_bias * vb->stride;