iris: Fix SINT assert in convert_fast_clear_color

Don't assert that the size of every channel is greater than zero. This
assert doesn't work for integer formats with less than 4 channels.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7345>
This commit is contained in:
Nanley Chery 2020-10-14 17:15:36 -07:00 committed by Marge Bot
parent 4cb9b5db2c
commit 60336cac60

View file

@ -179,8 +179,7 @@ convert_fast_clear_color(struct iris_context *ice,
for (int i = 0; i < 4; i++) {
unsigned bits = util_format_get_component_bits(
format, UTIL_FORMAT_COLORSPACE_RGB, i);
assert(bits > 0);
if (bits < 32) {
if (bits > 0 && bits < 32) {
int32_t max = (1 << (bits - 1)) - 1;
int32_t min = -(1 << (bits - 1));
override_color.i32[i] = CLAMP(override_color.i32[i], min, max);