aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_vbo_translate.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2012-05-16 20:54:23 +0200
committerChristoph Bumiller <[email protected]>2012-05-17 15:24:58 +0200
commitef7bb281292c17b762b57779306e874704c87328 (patch)
tree11bc7aedaceedb06087cc49621fdd2f80f6384c0 /src/gallium/drivers/nvc0/nvc0_vbo_translate.c
parentfcb28682101dfa127486373411043d5d97a0ff8f (diff)
nv50,nvc0: handle user index buffers
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_vbo_translate.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_vbo_translate.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_vbo_translate.c b/src/gallium/drivers/nvc0/nvc0_vbo_translate.c
index 26f8cb5fbaf..6317c21a8d7 100644
--- a/src/gallium/drivers/nvc0/nvc0_vbo_translate.c
+++ b/src/gallium/drivers/nvc0/nvc0_vbo_translate.c
@@ -78,11 +78,13 @@ nvc0_vertex_configure_translate(struct nvc0_context *nvc0, int32_t index_bias)
static INLINE void
nvc0_push_map_idxbuf(struct push_context *ctx, struct nvc0_context *nvc0)
{
- struct nv04_resource *buf = nv04_resource(nvc0->idxbuf.buffer);
- unsigned offset = nvc0->idxbuf.offset;
-
- ctx->idxbuf = nouveau_resource_map_offset(&nvc0->base,
- buf, offset, NOUVEAU_BO_RD);
+ if (nvc0->idxbuf.buffer) {
+ struct nv04_resource *buf = nv04_resource(nvc0->idxbuf.buffer);
+ ctx->idxbuf = nouveau_resource_map_offset(&nvc0->base,
+ buf, nvc0->idxbuf.offset, NOUVEAU_BO_RD);
+ } else {
+ ctx->idxbuf = nvc0->idxbuf.user_buffer;
+ }
}
static INLINE void