radv: fix shift overflow in radv_pipeline_init_dynamic_state

Fixes UBSan error with thewitness/005aa77325a11410:
runtime error: left shift of 15 by 28 places cannot be represented in type 'int'

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37055>
This commit is contained in:
Rhys Perry 2025-08-28 11:29:58 +01:00 committed by Marge Bot
parent 1105f7b98f
commit 7f5c84d7ac

View file

@ -1107,7 +1107,7 @@ radv_pipeline_init_dynamic_state(const struct radv_device *device, struct radv_g
if (states & RADV_DYNAMIC_COLOR_WRITE_MASK) {
for (unsigned i = 0; i < state->cb->attachment_count; i++) {
dynamic->color_write_mask |= state->cb->attachments[i].write_mask << (4 * i);
dynamic->color_write_mask |= (uint32_t)state->cb->attachments[i].write_mask << (4 * i);
}
}