Mesa (master): glsl: fix int16 type

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 10 09:21:08 UTC 2021


Module: Mesa
Branch: master
Commit: c64e2bf2c3d9d053ed063c07fa1b2bf618b1c740
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c64e2bf2c3d9d053ed063c07fa1b2bf618b1c740

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Apr  9 07:22:53 2021 +0200

glsl: fix int16 type

This shouldn't be unsigned, or else we'll trigger asserts.

Fixes: 7f00d4dac81 ("glsl: Handle 16-bit types in loop analysis")
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10125>

---

 src/compiler/glsl/loop_analysis.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/loop_analysis.cpp b/src/compiler/glsl/loop_analysis.cpp
index db54047f9e3..3273f2ba704 100644
--- a/src/compiler/glsl/loop_analysis.cpp
+++ b/src/compiler/glsl/loop_analysis.cpp
@@ -162,7 +162,7 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
          iter = new(mem_ctx) ir_constant(int32_t(iter_value + bias[i]));
          break;
       case GLSL_TYPE_INT16:
-         iter = new(mem_ctx) ir_constant(uint16_t(iter_value + bias[i]));
+         iter = new(mem_ctx) ir_constant(int16_t(iter_value + bias[i]));
          break;
       case GLSL_TYPE_INT64:
          iter = new(mem_ctx) ir_constant(int64_t(iter_value + bias[i]));



More information about the mesa-commit mailing list