radv: Fix various non-critical integer overflows
authorTony Wasserka <tony.wasserka@gmx.de>
Wed, 2 Sep 2020 16:13:57 +0000 (18:13 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 3 Sep 2020 20:20:24 +0000 (20:20 +0000)
commitf18fc34c4d56d6e7d511002b39a257e18d8b3af3
tree771a6e9943ace4bde5e69d89780d95b4e716d570
parenta99ae1943d880702c8472ea9be11e4f92b6a440f
radv: Fix various non-critical integer overflows

The result of 0xf << 28 is a signed integer and hence overflows into the sign
bit. In practice compilers did the right thing here, since the intent of the
code was unsigned arithmetic anyway.

These conditions were observed in:
* dEQP-VK.pipeline.image.suballocation.sampling_type.combined.view_type.1d.format.r4g4b4a4_unorm_pack16.count_8.size.512x1
* dEQP-VK.binding_model.descriptorset_random.sets32.noarray.ubolimitlow.sbolimitlow.sampledimglow.outimgonly.noiub.nouab.frag.ialimithigh.0

Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6568>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader_args.c
src/amd/vulkan/radv_shader_info.c