diff options
author | Marek Olšák <[email protected]> | 2012-01-02 01:13:15 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-01-05 18:29:11 +0100 |
commit | 0950086376b1c8b7fb89eda81ed7f2f06dee58bc (patch) | |
tree | 0ca11705eb95036df1590d2fda13239f684d6dee /src/gallium/drivers/i915 | |
parent | 7cd1c62b6be88072e3d937b67c499592490927f1 (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/i915')
-rw-r--r-- | src/gallium/drivers/i915/i915_resource_buffer.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_resource_texture.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_resource_buffer.c b/src/gallium/drivers/i915/i915_resource_buffer.c index 77c03450b3a..c54e481698e 100644 --- a/src/gallium/drivers/i915/i915_resource_buffer.c +++ b/src/gallium/drivers/i915/i915_resource_buffer.c @@ -68,8 +68,13 @@ i915_get_transfer(struct pipe_context *pipe, const struct pipe_box *box) { struct i915_context *i915 = i915_context(pipe); - struct pipe_transfer *transfer = util_slab_alloc(&i915->transfer_pool); + struct pipe_transfer *transfer; + if (usage & PIPE_TRANSFER_MAP_PERMANENTLY) { + return NULL; + } + + transfer = util_slab_alloc(&i915->transfer_pool); if (transfer == NULL) return NULL; diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c index 8ff733a7be5..64d071c9d53 100644 --- a/src/gallium/drivers/i915/i915_resource_texture.c +++ b/src/gallium/drivers/i915/i915_resource_texture.c @@ -720,9 +720,14 @@ i915_texture_get_transfer(struct pipe_context *pipe, { struct i915_context *i915 = i915_context(pipe); struct i915_texture *tex = i915_texture(resource); - struct i915_transfer *transfer = util_slab_alloc(&i915->texture_transfer_pool); + struct i915_transfer *transfer; boolean use_staging_texture = FALSE; + if (usage & PIPE_TRANSFER_MAP_PERMANENTLY) { + return NULL; + } + + transfer = util_slab_alloc(&i915->texture_transfer_pool); if (transfer == NULL) return NULL; |