aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-08-05 17:37:15 +0200
committerErik Faye-Lund <[email protected]>2019-08-15 20:23:13 +0200
commitb355eef92053feaa8254345a3359ff14555dd52f (patch)
tree80ee0d1dcd50525cd7c286c1e6a8c5000d31b78f /src
parentf741de236b5fa5522d8749a4b3e6d994fb98c630 (diff)
glsl: fixup u64-warning
Similarly to the unsigned-version, we need to first cast the result to a suiting integer before negating the number, otherwise we'll trigger a warning. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/ir_expression_operation.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir_expression_operation.py b/src/compiler/glsl/ir_expression_operation.py
index 306fc35f605..c80314a10dd 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -417,7 +417,7 @@ class operation(object):
ir_expression_operation = [
operation("bit_not", 1, printable_name="~", source_types=integer_types, c_expression="~ {src0}"),
operation("logic_not", 1, printable_name="!", source_types=(bool_type,), c_expression="!{src0}"),
- operation("neg", 1, source_types=numeric_types, c_expression={'u': "-((int) {src0})", 'default': "-{src0}"}),
+ operation("neg", 1, source_types=numeric_types, c_expression={'u': "-((int) {src0})", 'u64': "-((int64_t) {src0})", 'default': "-{src0}"}),
operation("abs", 1, source_types=signed_numeric_types, c_expression={'i': "{src0} < 0 ? -{src0} : {src0}", 'f': "fabsf({src0})", 'd': "fabs({src0})", 'i64': "{src0} < 0 ? -{src0} : {src0}"}),
operation("sign", 1, source_types=signed_numeric_types, c_expression={'i': "({src0} > 0) - ({src0} < 0)", 'f': "float(({src0} > 0.0F) - ({src0} < 0.0F))", 'd': "double(({src0} > 0.0) - ({src0} < 0.0))", 'i64': "({src0} > 0) - ({src0} < 0)"}),
operation("rcp", 1, source_types=real_types, c_expression={'f': "1.0F / {src0}", 'd': "1.0 / {src0}"}),