gallium/radeon: Rename do_invalidate_resource to invalidate_buffer
And only call it from r600_invalidate_resource for buffer resources. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
0491dd1deb
commit
ad20be1f30
|
@ -210,8 +210,8 @@ static void r600_buffer_destroy(struct pipe_screen *screen,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
r600_do_invalidate_resource(struct r600_common_context *rctx,
|
r600_invalidate_buffer(struct r600_common_context *rctx,
|
||||||
struct r600_resource *rbuffer)
|
struct r600_resource *rbuffer)
|
||||||
{
|
{
|
||||||
/* In AMD_pinned_memory, the user pointer association only gets
|
/* In AMD_pinned_memory, the user pointer association only gets
|
||||||
* broken when the buffer is explicitly re-allocated.
|
* broken when the buffer is explicitly re-allocated.
|
||||||
|
@ -236,7 +236,9 @@ void r600_invalidate_resource(struct pipe_context *ctx,
|
||||||
struct r600_common_context *rctx = (struct r600_common_context*)ctx;
|
struct r600_common_context *rctx = (struct r600_common_context*)ctx;
|
||||||
struct r600_resource *rbuffer = r600_resource(resource);
|
struct r600_resource *rbuffer = r600_resource(resource);
|
||||||
|
|
||||||
(void)r600_do_invalidate_resource(rctx, rbuffer);
|
/* We currently only do anyting here for buffers */
|
||||||
|
if (resource->target == PIPE_BUFFER)
|
||||||
|
(void)r600_invalidate_buffer(rctx, rbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *r600_buffer_get_transfer(struct pipe_context *ctx,
|
static void *r600_buffer_get_transfer(struct pipe_context *ctx,
|
||||||
|
@ -306,7 +308,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
|
||||||
!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
|
!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
|
||||||
assert(usage & PIPE_TRANSFER_WRITE);
|
assert(usage & PIPE_TRANSFER_WRITE);
|
||||||
|
|
||||||
if (r600_do_invalidate_resource(rctx, rbuffer)) {
|
if (r600_invalidate_buffer(rctx, rbuffer)) {
|
||||||
/* At this point, the buffer is always idle. */
|
/* At this point, the buffer is always idle. */
|
||||||
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
|
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue