Module: Mesa Branch: master Commit: de10428770e169e148ba5039d83d188fc1691f28 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=de10428770e169e148ba5039d83d188fc1691f28
Author: Dave Airlie <[email protected]> Date: Fri Dec 18 12:29:03 2020 +1000 llvmpipe: add support for grid base This adds the grid base into the compute launch Reviewed-by: Roland Scheidegger <[email protected]> Reviweed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8154> --- src/gallium/drivers/llvmpipe/lp_state_cs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index 414a1cd7190..5cb8ce3f111 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -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]; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
