summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-01-27 21:46:21 +0100
committerMarek Olšák <[email protected]>2014-02-25 16:05:41 +0100
commit6381dd7e9dd22987df21624965cc82cbeec237a3 (patch)
tree5c95ebc6c4504e02ebc8dc91d250eb5d97387295 /src/gallium/drivers/radeon
parentdfa0b8d9b87ba1094ba12e6feb554a1b09da2de5 (diff)
r300g,r600g,radeonsi: add support for ARB_buffer_storage
All GTT memory mappings are coherent and therefore can be persistent. Reviewed-by: Fredrik Höglund <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r--src/gallium/drivers/radeon/r600_buffer_common.c8
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index e75b3371f59..340ebb2bcd5 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -122,6 +122,14 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
break;
}
+ /* Use GTT for all persistent mappings, because they are
+ * always cached and coherent. */
+ if (res->b.b.target == PIPE_BUFFER &&
+ res->b.b.flags & (PIPE_RESOURCE_FLAG_MAP_PERSISTENT |
+ PIPE_RESOURCE_FLAG_MAP_COHERENT)) {
+ res->domains = RADEON_DOMAIN_GTT;
+ }
+
/* Tiled textures are unmappable. Always put them in VRAM. */
if (res->b.b.target != PIPE_BUFFER &&
rtex->surface.level[0].mode >= RADEON_SURF_MODE_1D) {
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index dbca157f04a..f38e333ebd3 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -39,6 +39,10 @@
* pipe_context
*/
+static void r600_memory_barrier(struct pipe_context *ctx, unsigned flags)
+{
+}
+
bool r600_common_context_init(struct r600_common_context *rctx,
struct r600_common_screen *rscreen)
{
@@ -56,6 +60,7 @@ bool r600_common_context_init(struct r600_common_context *rctx,
rctx->b.transfer_flush_region = u_default_transfer_flush_region;
rctx->b.transfer_unmap = u_transfer_unmap_vtbl;
rctx->b.transfer_inline_write = u_default_transfer_inline_write;
+ rctx->b.memory_barrier = r600_memory_barrier;
r600_streamout_init(rctx);
r600_query_init(rctx);