summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv30/nv30_draw.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
committerMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
commitbb4c5d72d7c7cb1d9e7016e2c07c36875f30011a (patch)
tree153444ff535900f82ae63b5af8ccd09fb2f063af /src/gallium/drivers/nv30/nv30_draw.c
parent96956dc5076fc03b9290368ca90e3f3b870ee613 (diff)
parent8dd3e341b337ca2d22bcc0e7548a78a6c36ca77d (diff)
Merge branch 'gallium-userbuf'
Conflicts: src/gallium/docs/source/screen.rst src/gallium/drivers/nv50/nv50_state.c src/gallium/include/pipe/p_defines.h src/mesa/state_tracker/st_draw.c
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_draw.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_draw.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/nv30/nv30_draw.c b/src/gallium/drivers/nv30/nv30_draw.c
index 61e324606f2..29e63953838 100644
--- a/src/gallium/drivers/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nv30/nv30_draw.c
@@ -366,7 +366,7 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
{
struct nv30_context *nv30 = nv30_context(pipe);
struct draw_context *draw = nv30->draw;
- struct pipe_transfer *transfer[PIPE_MAX_ATTRIBS];
+ struct pipe_transfer *transfer[PIPE_MAX_ATTRIBS] = {NULL};
struct pipe_transfer *transferi = NULL;
int i;
@@ -403,14 +403,18 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
}
for (i = 0; i < nv30->num_vtxbufs; i++) {
- void *map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
+ const void *map = nv30->vtxbuf[i].user_buffer;
+ if (!map)
+ map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
PIPE_TRANSFER_UNSYNCHRONIZED |
PIPE_TRANSFER_READ, &transfer[i]);
draw_set_mapped_vertex_buffer(draw, i, map);
}
if (info->indexed) {
- void *map = pipe_buffer_map(pipe, nv30->idxbuf.buffer,
+ const void *map = nv30->idxbuf.user_buffer;
+ if (!map)
+ pipe_buffer_map(pipe, nv30->idxbuf.buffer,
PIPE_TRANSFER_UNSYNCHRONIZED |
PIPE_TRANSFER_READ, &transferi);
draw_set_index_buffer(draw, &nv30->idxbuf);
@@ -422,10 +426,11 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
draw_vbo(draw, info);
draw_flush(draw);
- if (info->indexed)
+ if (info->indexed && transferi)
pipe_buffer_unmap(pipe, transferi);
for (i = 0; i < nv30->num_vtxbufs; i++)
- pipe_buffer_unmap(pipe, transfer[i]);
+ if (transfer[i])
+ pipe_buffer_unmap(pipe, transfer[i]);
nv30->draw_dirty = 0;
nv30_state_release(nv30);