[Mesa-dev] [PATCH 3/3] r600g, radeonsi: implement resource_invalidate hook
Marek Olšák
maraeo at gmail.com
Sun Mar 16 10:00:54 PDT 2014
From: Marek Olšák <marek.olsak at amd.com>
The invalidation is already implemented by the driver.
---
src/gallium/drivers/radeon/r600_pipe_common.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 5f6e0fc..44fb7ae 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -43,6 +43,18 @@ static void r600_memory_barrier(struct pipe_context *ctx, unsigned flags)
{
}
+static void r600_resource_invalidate(struct pipe_context *ctx,
+ struct pipe_resource *res,
+ struct pipe_box *box)
+{
+ struct r600_common_context *rctx = (struct r600_common_context *)ctx;
+
+ if (res->target == PIPE_BUFFER &&
+ box->x == 0 && box->width == res->width0) {
+ rctx->invalidate_buffer(ctx, res);
+ }
+}
+
static void r600_flush_dma_ring(void *ctx, unsigned flags)
{
struct r600_common_context *rctx = (struct r600_common_context *)ctx;
@@ -82,6 +94,7 @@ bool r600_common_context_init(struct r600_common_context *rctx,
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;
+ rctx->b.resource_invalidate = r600_resource_invalidate;
r600_init_context_texture_functions(rctx);
r600_streamout_init(rctx);
--
1.8.3.2
More information about the mesa-dev
mailing list