mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 04:10:09 +01:00
panvk: assert that shader_present isn't zero
If it is, util_last_bit() will return zero, and the subtraction that follows will underflow. Make it obvious that this can't happen, by adding an assert here. CID: 1665297 Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37903>
This commit is contained in:
parent
22d929f265
commit
c8e30c7a9f
1 changed files with 1 additions and 0 deletions
|
|
@ -457,6 +457,7 @@ panvk_preprocess_nir(struct vk_physical_device *vk_pdev,
|
|||
NIR_PASS(_, nir, nir_split_var_copies);
|
||||
NIR_PASS(_, nir, nir_lower_var_copies);
|
||||
|
||||
assert(pdev->kmod.props.shader_present != 0);
|
||||
uint64_t core_max_id = util_last_bit(pdev->kmod.props.shader_present) - 1;
|
||||
NIR_PASS(_, nir, nir_inline_sysval, nir_intrinsic_load_core_max_id_arm,
|
||||
core_max_id);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue