All GTT memory mappings are coherent and therefore can be persistent.
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
case PIPE_CAP_USER_INDEX_BUFFERS:
case PIPE_CAP_USER_CONSTANT_BUFFERS:
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
+ case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
return 1;
case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
r300_mark_atom_dirty(r300, &r300->texture_cache_inval);
}
+static void r300_memory_barrier(struct pipe_context *pipe, unsigned flags)
+{
+}
+
void r300_init_state_functions(struct r300_context* r300)
{
r300->context.create_blend_state = r300_create_blend_state;
r300->context.delete_vs_state = r300_delete_vs_state;
r300->context.texture_barrier = r300_texture_barrier;
+ r300->context.memory_barrier = r300_memory_barrier;
}
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
case PIPE_CAP_TEXTURE_MULTISAMPLE:
+ case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
return 1;
case PIPE_CAP_TGSI_TEXCOORD:
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) {
* 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)
{
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);
case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
case PIPE_CAP_TGSI_VS_LAYER:
case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
+ case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
return 1;
case PIPE_CAP_TEXTURE_MULTISAMPLE: