mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 10:20:09 +01:00
ac/nir/taskmesh: Use 3 dimensional workgroup ID.
For the sake of consistency, do not rely on a 1-dimensional workgroup ID anymore. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16721>
This commit is contained in:
parent
c6d12a510c
commit
2027f28b30
1 changed files with 10 additions and 2 deletions
|
|
@ -147,8 +147,16 @@ task_workgroup_index(nir_builder *b,
|
|||
{
|
||||
nir_ssa_def *id = nir_load_workgroup_id(b, 32);
|
||||
|
||||
/* NV_mesh_shader: workgroups are always 1D, so index is the same as ID.x */
|
||||
return nir_channel(b, id, 0);
|
||||
nir_ssa_def *x = nir_channel(b, id, 0);
|
||||
nir_ssa_def *y = nir_channel(b, id, 1);
|
||||
nir_ssa_def *z = nir_channel(b, id, 2);
|
||||
|
||||
nir_ssa_def *grid_size = nir_load_num_workgroups(b, 32);
|
||||
nir_ssa_def *grid_size_x = nir_channel(b, grid_size, 0);
|
||||
nir_ssa_def *grid_size_y = nir_channel(b, grid_size, 1);
|
||||
|
||||
return nir_iadd(b, nir_imul(b, nir_imul(b, grid_size_x, grid_size_y), z),
|
||||
nir_iadd(b, nir_imul(b, grid_size_x, y), x));
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue