llvmpipe: add support for grid base
This adds the grid base into the compute launch Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviweed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8154>
This commit is contained in:
@@ -55,6 +55,7 @@ static unsigned cs_no = 0;
|
||||
|
||||
struct lp_cs_job_info {
|
||||
unsigned grid_size[3];
|
||||
unsigned grid_base[3];
|
||||
unsigned block_size[3];
|
||||
unsigned req_local_mem;
|
||||
unsigned work_dim;
|
||||
@@ -1277,6 +1278,10 @@ cs_exec_fn(void *init_data, int iter_idx, struct lp_cs_local_mem *lmem)
|
||||
unsigned grid_z = iter_idx / (job_info->grid_size[0] * job_info->grid_size[1]);
|
||||
unsigned grid_y = (iter_idx - (grid_z * (job_info->grid_size[0] * job_info->grid_size[1]))) / job_info->grid_size[0];
|
||||
unsigned grid_x = (iter_idx - (grid_z * (job_info->grid_size[0] * job_info->grid_size[1])) - (grid_y * job_info->grid_size[0]));
|
||||
|
||||
grid_z += job_info->grid_base[2];
|
||||
grid_y += job_info->grid_base[1];
|
||||
grid_x += job_info->grid_base[0];
|
||||
struct lp_compute_shader_variant *variant = job_info->current->variant;
|
||||
variant->jit_function(&job_info->current->jit_context,
|
||||
job_info->block_size[0], job_info->block_size[1], job_info->block_size[2],
|
||||
@@ -1329,6 +1334,9 @@ static void llvmpipe_launch_grid(struct pipe_context *pipe,
|
||||
|
||||
fill_grid_size(pipe, info, job_info.grid_size);
|
||||
|
||||
job_info.grid_base[0] = info->grid_base[0];
|
||||
job_info.grid_base[1] = info->grid_base[1];
|
||||
job_info.grid_base[2] = info->grid_base[2];
|
||||
job_info.block_size[0] = info->block[0];
|
||||
job_info.block_size[1] = info->block[1];
|
||||
job_info.block_size[2] = info->block[2];
|
||||
|
||||
Reference in New Issue
Block a user