From: Alyssa Rosenzweig Date: Mon, 6 Jul 2020 21:56:38 +0000 (-0400) Subject: glsl: Handle 16-bit types in loop analysis X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f00d4dac813836d9767efa381c43514b2a999cc;p=mesa.git glsl: Handle 16-bit types in loop analysis Fixes crash with mediump lowering in: dEQP-GLES2.functional.shaders.loops.do_while_constant_iterations.basic_mediump_float_fragment Signed-off-by: Alyssa Rosenzweig Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/compiler/glsl/loop_analysis.cpp b/src/compiler/glsl/loop_analysis.cpp index 9429e69c2a7..6f0b3287a5b 100644 --- a/src/compiler/glsl/loop_analysis.cpp +++ b/src/compiler/glsl/loop_analysis.cpp @@ -161,12 +161,21 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, case GLSL_TYPE_INT: iter = new(mem_ctx) ir_constant(iter_value + bias[i]); break; + case GLSL_TYPE_INT16: + iter = new(mem_ctx) ir_constant(uint16_t(iter_value + bias[i])); + break; case GLSL_TYPE_UINT: iter = new(mem_ctx) ir_constant(unsigned(iter_value + bias[i])); break; + case GLSL_TYPE_UINT16: + iter = new(mem_ctx) ir_constant(uint16_t(iter_value + bias[i])); + break; case GLSL_TYPE_FLOAT: iter = new(mem_ctx) ir_constant(float(iter_value + bias[i])); break; + case GLSL_TYPE_FLOAT16: + iter = new(mem_ctx) ir_constant(float16_t(float(iter_value + bias[i]))); + break; case GLSL_TYPE_DOUBLE: iter = new(mem_ctx) ir_constant(double(iter_value + bias[i])); break;