aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-01-02 01:13:15 +0100
committerMarek Olšák <[email protected]>2012-01-05 18:29:11 +0100
commit0950086376b1c8b7fb89eda81ed7f2f06dee58bc (patch)
tree0ca11705eb95036df1590d2fda13239f684d6dee /src/gallium/drivers/svga
parent7cd1c62b6be88072e3d937b67c499592490927f1 (diff)
gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY
Please see the diff for further info. This paves the way for moving user buffer uploads out of drivers and should allow to clean up the mess in u_upload_mgr in the meantime. For now only allowed for buffers on r300 and r600. Acked-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer.c4
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c
index fa713ee88ad..57ec752bf9b 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.c
+++ b/src/gallium/drivers/svga/svga_resource_buffer.c
@@ -74,6 +74,10 @@ svga_buffer_get_transfer(struct pipe_context *pipe,
struct svga_buffer *sbuf = svga_buffer(resource);
struct pipe_transfer *transfer;
+ if (usage & PIPE_TRANSFER_MAP_PERMANENTLY) {
+ return NULL;
+ }
+
transfer = CALLOC_STRUCT(pipe_transfer);
if (transfer == NULL) {
return NULL;
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index 697c1d3c5e3..4eb1068e226 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -259,7 +259,7 @@ svga_texture_get_transfer(struct pipe_context *pipe,
unsigned nblocksy = util_format_get_nblocksy(texture->format, box->height);
/* We can't map texture storage directly */
- if (usage & PIPE_TRANSFER_MAP_DIRECTLY)
+ if (usage & (PIPE_TRANSFER_MAP_DIRECTLY | PIPE_TRANSFER_MAP_PERMANENTLY))
return NULL;
assert(box->depth == 1);