mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 02:04:41 +08:00
nir/lower_system_values: add ID to 32-bit lowering
OpenCL has 64-bit global IDs, but for driver-internal OpenCL we only need 32-bit. Might as well lower in nir_lower_system_values instead of bringing up a whole new pass just for this. Will be used for asahi precomp Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32210>
This commit is contained in:
parent
f682982e53
commit
0aaf174e31
@ -6174,6 +6174,7 @@ typedef struct nir_lower_compute_system_values_options {
|
||||
bool lower_local_invocation_index : 1;
|
||||
bool lower_cs_local_id_to_index : 1;
|
||||
bool lower_workgroup_id_to_index : 1;
|
||||
bool global_id_is_32bit : 1;
|
||||
/* At shader execution time, check if WorkGroupId should be 1D
|
||||
* and compute it quickly. Fall back to slow computation if not.
|
||||
*/
|
||||
|
@ -719,6 +719,8 @@ lower_compute_system_value_instr(nir_builder *b,
|
||||
base_group_id),
|
||||
nir_u2uN(b, group_size, bit_size)),
|
||||
nir_u2uN(b, local_id, bit_size));
|
||||
} else if (options && options->global_id_is_32bit && bit_size > 32) {
|
||||
return nir_u2uN(b, nir_load_global_invocation_id(b, 32), bit_size);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user