From 1ae982adfd8144d11334895c39aca65dd30ad946 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sat, 15 Jan 2011 12:18:52 +0100 Subject: nvc0: update user vbufs on each draw call This is required in case set_vertex_buffers is not called again. --- src/gallium/drivers/nvc0/nvc0_resource.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/nvc0/nvc0_resource.h') diff --git a/src/gallium/drivers/nvc0/nvc0_resource.h b/src/gallium/drivers/nvc0/nvc0_resource.h index d33e2f0ed0..17e79642a6 100644 --- a/src/gallium/drivers/nvc0/nvc0_resource.h +++ b/src/gallium/drivers/nvc0/nvc0_resource.h @@ -18,6 +18,12 @@ struct nvc0_context; #define NVC0_BUFFER_SCORE_MAX 25000 #define NVC0_BUFFER_SCORE_VRAM_THRESHOLD 20000 +/* DIRTY: buffer was (or will be after the next flush) written to by GPU and + * resource->data has not been updated to reflect modified VRAM contents + * + * USER_MEMORY: resource->data is a pointer to client memory and may change + * between GL calls + */ #define NVC0_BUFFER_STATUS_DIRTY (1 << 0) #define NVC0_BUFFER_STATUS_USER_MEMORY (1 << 7) @@ -84,7 +90,8 @@ nvc0_resource_map_offset(struct nvc0_context *nvc0, (res->status & NVC0_BUFFER_STATUS_DIRTY)) nvc0_buffer_download(nvc0, res, 0, res->base.width0); - if (res->domain != NOUVEAU_BO_GART) + if ((res->domain != NOUVEAU_BO_GART) || + (res->status & NVC0_BUFFER_STATUS_USER_MEMORY)) return res->data + offset; if (res->mm) @@ -189,6 +196,6 @@ void nvc0_miptree_surface_del(struct pipe_context *, struct pipe_surface *); boolean -nvc0_migrate_vertices(struct nvc0_resource *buf, unsigned base, unsigned size); +nvc0_user_buffer_upload(struct nvc0_resource *, unsigned base, unsigned size); #endif -- cgit v1.2.3