glsl: tolerate int16 loop counters

When lowering precision on integers from GLSL ES, we can end up with
16 bit integer loop counters. So let's tolerate this as well.

This was probably not caught earlier because most NIR drivers disable
GLSL-level loop-unrolling, and no non-NIR driver sets LowerPrecisionInt16
to true. This was discovered while trying to wire up int16 support for
Zink, which doesn't currently disable GLSL loop-unrolling.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10125>
This commit is contained in:
Erik Faye-Lund
2021-04-09 07:25:03 +02:00
committed by Marge Bot
parent c64e2bf2c3
commit a161cccd9b

View File

@@ -107,7 +107,7 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
return -1;
}
if (!iter->type->is_integer_32() && !iter->type->is_integer_64()) {
if (!iter->type->is_integer()) {
const ir_expression_operation op = iter->type->is_double()
? ir_unop_d2i : ir_unop_f2i;
ir_rvalue *cast =