summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0/nvc0_resource.h
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-01-15 12:18:52 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-01-15 12:18:52 +0100
commit1ae982adfd8144d11334895c39aca65dd30ad946 (patch)
tree3094c3dcbbcef33d49ea62189c4f0b9d33063fd6 /src/gallium/drivers/nvc0/nvc0_resource.h
parentb50d02e2e0729de101fd0acddeac21cca038786e (diff)
nvc0: update user vbufs on each draw call
This is required in case set_vertex_buffers is not called again.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_resource.h')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_resource.h11
1 files changed, 9 insertions, 2 deletions
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