summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2021-04-09 07:22:53 +0200
committerDylan Baker <dylan.c.baker@intel.com>2021-04-21 09:53:36 -0700
commit422aeb17f87a8b64328d98fa08fd1957ab58af73 (patch)
tree4c71a88102628bffb84aa82ac91c9059849551c5
parent7d447b0223cc338b7e2b0811351656040a3e61cf (diff)
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@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10125> (cherry picked from commit c64e2bf2c3d9d053ed063c07fa1b2bf618b1c740)
-rw-r--r--.pick_status.json2
-rw-r--r--src/compiler/glsl/loop_analysis.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 060f4fb61b7..5c62246ef66 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1903,7 +1903,7 @@
"description": "glsl: fix int16 type",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "7f00d4dac813836d9767efa381c43514b2a999cc"
},
diff --git a/src/compiler/glsl/loop_analysis.cpp b/src/compiler/glsl/loop_analysis.cpp
index 301b7f343fa..f4e2c950521 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(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_UINT:
iter = new(mem_ctx) ir_constant(unsigned(iter_value + bias[i]));