From: Jonathan Charest Date: Mon, 22 Jul 2013 13:24:56 +0000 (-0400) Subject: r600g/compute: Added missing address space checking of kernel parameters X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f8048bb5a8558ae4313b12ffd70b593cc629fe8;p=mesa.git r600g/compute: Added missing address space checking of kernel parameters To have non-static buffers in local memory, it is necessary to pass them as arguments to the kernel. For r600, the correct lds size must be set to the SQ_LDS_ALLOC register. The correct size is the clover size plus the size reported by the compiler. Reviewed-by: Tom Stellard --- diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index f76fc9cc25e..9b2bae3e841 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -211,8 +211,7 @@ void *evergreen_create_compute_state( #endif shader->ctx = (struct r600_context*)ctx; - /* XXX: We ignore cso->req_local_mem, because we compute this value - * ourselves on a per-kernel basis. */ + shader->local_size = cso->req_local_mem; shader->private_size = cso->req_private_mem; shader->input_size = cso->req_input_mem; @@ -334,7 +333,7 @@ static void evergreen_emit_direct_dispatch( unsigned wave_divisor = (16 * num_pipes); int group_size = 1; int grid_size = 1; - unsigned lds_size = shader->active_kernel->bc.nlds_dw; + unsigned lds_size = shader->local_size / 4 + shader->active_kernel->bc.nlds_dw; /* Calculate group_size/grid_size */ for (i = 0; i < 3; i++) {