diff options
author | Samuel Pitoiset <[email protected]> | 2017-12-14 16:48:02 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-12-14 22:22:04 +0100 |
commit | e0019444104722e8084aa76a090af5fbaeb77943 (patch) | |
tree | aae81668c3fdc86dfe6f5bbe13f7e35e278755cb | |
parent | 42285ed8c33c163914224719a5dabb54229046a9 (diff) |
amd/common: scan which components of gl_LocalInvocationID are used
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/common/ac_shader_info.c | 7 | ||||
-rw-r--r-- | src/amd/common/ac_shader_info.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c index 01949770d68..87744ed23e1 100644 --- a/src/amd/common/ac_shader_info.c +++ b/src/amd/common/ac_shader_info.c @@ -45,11 +45,16 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, struct ac_shader_info *info) case nir_intrinsic_load_num_work_groups: info->cs.uses_grid_size = true; break; + case nir_intrinsic_load_local_invocation_id: case nir_intrinsic_load_work_group_id: { unsigned mask = nir_ssa_def_components_read(&instr->dest.ssa); while (mask) { unsigned i = u_bit_scan(&mask); - info->cs.uses_block_id[i] = true; + + if (instr->intrinsic == nir_intrinsic_load_work_group_id) + info->cs.uses_block_id[i] = true; + else + info->cs.uses_thread_id[i] = true; } break; } diff --git a/src/amd/common/ac_shader_info.h b/src/amd/common/ac_shader_info.h index 7beefd02ac5..0136d5af403 100644 --- a/src/amd/common/ac_shader_info.h +++ b/src/amd/common/ac_shader_info.h @@ -44,6 +44,7 @@ struct ac_shader_info { struct { bool uses_grid_size; bool uses_block_id[3]; + bool uses_thread_id[3]; } cs; }; |