diff options
author | Maxence Le Dore <[email protected]> | 2012-12-13 05:17:35 +0100 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-12-13 19:40:28 +0000 |
commit | 6d7d821e3df7dde45fbd7ae2988eee8e94baa14f (patch) | |
tree | 5e2e3a4b1e0513a1376652ca56e68b715d3eaa0f /src/gallium/drivers/r600/evergreen_compute.c | |
parent | c68babfc3c7b65dd53697528781bd6b6186f5190 (diff) |
r600g/radeonsi: Silence warnings
Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_compute.c')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_compute.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index 44831a76188..66b0cc6d92c 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -804,15 +804,19 @@ struct pipe_resource *r600_compute_global_buffer_create( struct pipe_screen *screen, const struct pipe_resource *templ) { + struct r600_resource_global* result = NULL; + struct r600_screen* rscreen = NULL; + int size_in_dw = 0; + assert(templ->target == PIPE_BUFFER); assert(templ->bind & PIPE_BIND_GLOBAL); assert(templ->array_size == 1 || templ->array_size == 0); assert(templ->depth0 == 1 || templ->depth0 == 0); assert(templ->height0 == 1 || templ->height0 == 0); - struct r600_resource_global* result = (struct r600_resource_global*) - CALLOC(sizeof(struct r600_resource_global), 1); - struct r600_screen* rscreen = (struct r600_screen*)screen; + result = (struct r600_resource_global*) + CALLOC(sizeof(struct r600_resource_global), 1); + rscreen = (struct r600_screen*)screen; COMPUTE_DBG("*** r600_compute_global_buffer_create\n"); COMPUTE_DBG("width = %u array_size = %u\n", templ->width0, @@ -823,7 +827,7 @@ struct pipe_resource *r600_compute_global_buffer_create( result->base.b.b = *templ; pipe_reference_init(&result->base.b.b.reference, 1); - int size_in_dw = (templ->width0+3) / 4; + size_in_dw = (templ->width0+3) / 4; result->chunk = compute_memory_alloc(rscreen->global_pool, size_in_dw); @@ -840,11 +844,14 @@ void r600_compute_global_buffer_destroy( struct pipe_screen *screen, struct pipe_resource *res) { + struct r600_resource_global* buffer = NULL; + struct r600_screen* rscreen = NULL; + assert(res->target == PIPE_BUFFER); assert(res->bind & PIPE_BIND_GLOBAL); - struct r600_resource_global* buffer = (struct r600_resource_global*)res; - struct r600_screen* rscreen = (struct r600_screen*)screen; + buffer = (struct r600_resource_global*)res; + rscreen = (struct r600_screen*)screen; compute_memory_free(rscreen->global_pool, buffer->chunk->id); @@ -911,12 +918,14 @@ void r600_compute_global_transfer_unmap( struct pipe_context *ctx_, struct pipe_transfer* transfer) { + struct r600_context *ctx = NULL; + struct r600_resource_global* buffer = NULL; + assert(transfer->resource->target == PIPE_BUFFER); assert(transfer->resource->bind & PIPE_BIND_GLOBAL); - struct r600_context *ctx = (struct r600_context *)ctx_; - struct r600_resource_global* buffer = - (struct r600_resource_global*)transfer->resource; + ctx = (struct r600_context *)ctx_; + buffer = (struct r600_resource_global*)transfer->resource; COMPUTE_DBG("* r600_compute_global_transfer_unmap()\n"); |