No backend supports 64 bit values natively anyway.
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905>
task_workgroup_index(nir_builder *b,
lower_tsms_io_state *s)
{
- nir_def *id = nir_load_workgroup_id(b, 32);
+ nir_def *id = nir_load_workgroup_id(b);
nir_def *x = nir_channel(b, id, 0);
nir_def *y = nir_channel(b, id, 1);
unsigned mask = BITFIELD_MASK(num_components);
nir_def *local_ids = nir_channels(b, nir_load_local_invocation_id(b), mask);
- nir_def *block_ids = nir_channels(b, nir_load_workgroup_id(b, 32), mask);
+ nir_def *block_ids = nir_channels(b, nir_load_workgroup_id(b), mask);
nir_def *block_size =
nir_channels(b,
nir_imm_ivec4(b, b->shader->info.workgroup_size[0], b->shader->info.workgroup_size[1],
nir_def *data = nir_swizzle(&b, nir_channel(&b, pconst, 3), (unsigned[]){0, 0, 0, 0}, 4);
nir_def *global_id = nir_iadd(
- &b, nir_imul_imm(&b, nir_channel(&b, nir_load_workgroup_id(&b, 32), 0), b.shader->info.workgroup_size[0]),
+ &b, nir_imul_imm(&b, nir_channel(&b, nir_load_workgroup_id(&b), 0), b.shader->info.workgroup_size[0]),
nir_load_local_invocation_index(&b));
nir_def *offset = nir_imin(&b, nir_imul_imm(&b, global_id, 16), max_offset);
nir_def *dst_addr = nir_pack_64_2x32(&b, nir_channels(&b, pconst, 0b1100));
nir_def *global_id = nir_iadd(
- &b, nir_imul_imm(&b, nir_channel(&b, nir_load_workgroup_id(&b, 32), 0), b.shader->info.workgroup_size[0]),
+ &b, nir_imul_imm(&b, nir_channel(&b, nir_load_workgroup_id(&b), 0), b.shader->info.workgroup_size[0]),
nir_load_local_invocation_index(&b));
nir_def *offset = nir_u2u64(&b, nir_imin(&b, nir_imul_imm(&b, global_id, 16), max_offset));
output_img->data.binding = 1;
nir_def *invoc_id = nir_load_local_invocation_id(&b);
- nir_def *wg_id = nir_load_workgroup_id(&b, 32);
+ nir_def *wg_id = nir_load_workgroup_id(&b);
nir_def *block_size = nir_imm_ivec4(&b, b.shader->info.workgroup_size[0], b.shader->info.workgroup_size[1],
b.shader->info.workgroup_size[2], 0);
output_img->data.binding = 1;
nir_def *invoc_id = nir_load_local_invocation_id(&b);
- nir_def *wg_id = nir_load_workgroup_id(&b, 32);
+ nir_def *wg_id = nir_load_workgroup_id(&b);
nir_def *block_size = nir_imm_ivec3(&b, b.shader->info.workgroup_size[0], b.shader->info.workgroup_size[1],
b.shader->info.workgroup_size[2]);
* ever change any of these parameters we need to update how we compute the
* query index here.
*/
- nir_def *wg_id = nir_channel(&b, nir_load_workgroup_id(&b, 32), 0);
+ nir_def *wg_id = nir_channel(&b, nir_load_workgroup_id(&b), 0);
nir_def *offset =
nir_load_push_constant(&b, 1, 32, nir_imm_int(&b, 0), .base = 0, .range = 4);
* ever change any of these parameters we need to update how we compute the
* query index here.
*/
- nir_def *wg_id = nir_channel(&b, nir_load_workgroup_id(&b, 32), 0);
+ nir_def *wg_id = nir_channel(&b, nir_load_workgroup_id(&b), 0);
nir_def *avail_offset =
nir_load_push_constant(&b, 1, 32, nir_imm_int(&b, 0), .base = 0, .range = 4);
* ever change any of these parameters we need to update how we compute the
* query index here.
*/
- nir_def *wg_id = nir_channel(&b, nir_load_workgroup_id(&b, 32), 0);
+ nir_def *wg_id = nir_channel(&b, nir_load_workgroup_id(&b), 0);
nir_def *query_idx = nir_iadd(&b, base_query_idx, wg_id);
/* Read query availability if needed */
system_value("local_invocation_index", 1)
# zero_base indicates it starts from 0 for the current dispatch
# non-zero_base indicates the base is included
-system_value("workgroup_id", 3, bit_sizes=[32, 64])
+system_value("workgroup_id", 3)
system_value("workgroup_id_zero_base", 3)
# The workgroup_index is intended for situations when a 3 dimensional
# workgroup_id is not available on the HW, but a 1 dimensional index is.
case nir_intrinsic_load_local_invocation_id:
case nir_intrinsic_load_local_invocation_index:
+ case nir_intrinsic_load_workgroup_id:
case nir_intrinsic_load_workgroup_size:
return sanitize_32bit_sysval(b, intrin);
if ((options && options->has_base_workgroup_id) ||
!b->shader->options->has_cs_global_id) {
nir_def *group_size = nir_load_workgroup_size(b);
- nir_def *group_id = nir_load_workgroup_id(b, bit_size);
+ nir_def *group_id = nir_load_workgroup_id(b);
nir_def *local_id = nir_load_local_invocation_id(b);
- return nir_iadd(b, nir_imul(b, group_id, nir_u2uN(b, group_size, bit_size)),
+ return nir_iadd(b, nir_imul(b, nir_u2uN(b, group_id, bit_size),
+ nir_u2uN(b, group_size, bit_size)),
nir_u2uN(b, local_id, bit_size));
} else {
return NULL;
load = nir_load_local_invocation_id(b);
break;
case TGSI_SEMANTIC_BLOCK_ID:
- load = nir_load_workgroup_id(b, 32);
+ load = nir_load_workgroup_id(b);
break;
case TGSI_SEMANTIC_BLOCK_SIZE:
load = nir_load_workgroup_size(b);
unsigned mask = BITFIELD_MASK(num_components);
nir_def *local_ids = nir_channels(b, nir_load_local_invocation_id(b), mask);
- nir_def *block_ids = nir_channels(b, nir_load_workgroup_id(b, 32), mask);
+ nir_def *block_ids = nir_channels(b, nir_load_workgroup_id(b), mask);
nir_def *block_size = nir_channels(b, nir_load_workgroup_size(b), mask);
return nir_iadd(b, nir_imul(b, block_ids, block_size), local_ids);
}
b.shader->info.workgroup_size[1],
b.shader->info.workgroup_size[2],
0);
- nir_def *wid = nir_load_workgroup_id(&b, 32);
+ nir_def *wid = nir_load_workgroup_id(&b);
nir_def *iid = nir_load_local_invocation_id(&b);
nir_def *tile = nir_imul(&b, wid, bsize);
nir_def *global_id = nir_iadd(&b, tile, iid);