summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_vbo.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2011-03-01 15:28:26 +1000
committerBen Skeggs <[email protected]>2011-03-01 17:23:31 +1000
commit1ba8e9510812f155359d380bda6876cdee5ba21e (patch)
treeed88f07edf5da16df482e1a3c35f5675f9ab7e2b /src/gallium/drivers/nvc0/nvc0_vbo.c
parent96d57722fda62e7710eb5281bcf014ddfb824ef9 (diff)
nouveau: ensure vbo_dirty is set when buffer write transfer complete
This introduces a shared nouveau_context struct to track such things. Signed-off-by: Ben Skeggs <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_vbo.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_vbo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_vbo.c b/src/gallium/drivers/nvc0/nvc0_vbo.c
index 14bea675a11..e7e7ce7dc22 100644
--- a/src/gallium/drivers/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nvc0/nvc0_vbo.c
@@ -136,7 +136,7 @@ nvc0_emit_vtxattr(struct nvc0_context *nvc0, struct pipe_vertex_buffer *vb,
int i;
const unsigned nc = util_format_get_nr_components(ve->src_format);
- data = nouveau_resource_map_offset(&nvc0->pipe, res, vb->buffer_offset +
+ data = nouveau_resource_map_offset(&nvc0->base, res, vb->buffer_offset +
ve->src_offset, NOUVEAU_BO_RD);
util_format_read_4f(ve->src_format, v, 0, data, 0, 0, 0, 1, 1);
@@ -193,13 +193,13 @@ nvc0_prevalidate_vbufs(struct nvc0_context *nvc0)
nvc0_vbuf_range(nvc0, i, &base, &size);
nouveau_user_buffer_upload(buf, base, size);
} else {
- nouveau_buffer_migrate(&nvc0->pipe, buf, NOUVEAU_BO_GART);
+ nouveau_buffer_migrate(&nvc0->base, buf, NOUVEAU_BO_GART);
}
- nvc0->vbo_dirty = TRUE;
+ nvc0->base.vbo_dirty = TRUE;
}
}
nvc0_bufctx_add_resident(nvc0, NVC0_BUFCTX_VERTEX, buf, NOUVEAU_BO_RD);
- nouveau_buffer_adjust_score(&nvc0->pipe, buf, 1);
+ nouveau_buffer_adjust_score(&nvc0->base, buf, 1);
}
}
@@ -240,7 +240,7 @@ nvc0_update_user_vbufs(struct nvc0_context *nvc0)
OUT_RESRCh(chan, buf, offset, NOUVEAU_BO_RD);
OUT_RESRCl(chan, buf, offset, NOUVEAU_BO_RD);
}
- nvc0->vbo_dirty = TRUE;
+ nvc0->base.vbo_dirty = TRUE;
}
static INLINE void
@@ -518,7 +518,7 @@ nvc0_draw_elements(struct nvc0_context *nvc0, boolean shorten,
unsigned offset = nvc0->idxbuf.offset;
unsigned limit = nvc0->idxbuf.buffer->width0 - 1;
- nouveau_buffer_adjust_score(&nvc0->pipe, res, 1);
+ nouveau_buffer_adjust_score(&nvc0->base, res, 1);
while (instance_count--) {
MARK_RING (chan, 11, 4);
@@ -539,7 +539,7 @@ nvc0_draw_elements(struct nvc0_context *nvc0, boolean shorten,
mode |= NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT;
}
} else {
- data = nouveau_resource_map_offset(&nvc0->pipe,
+ data = nouveau_resource_map_offset(&nvc0->base,
nv04_resource(nvc0->idxbuf.buffer),
nvc0->idxbuf.offset, NOUVEAU_BO_RD);
if (!data)
@@ -610,10 +610,10 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
OUT_RING (chan, info->start_instance);
}
- if (nvc0->vbo_dirty) {
+ if (nvc0->base.vbo_dirty) {
BEGIN_RING(chan, RING_3D(VERTEX_ARRAY_FLUSH), 1);
OUT_RING (chan, 0);
- nvc0->vbo_dirty = FALSE;
+ nvc0->base.vbo_dirty = FALSE;
}
if (!info->indexed) {