summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_minmax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/opt_minmax.cpp')
-rw-r--r--src/glsl/opt_minmax.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/opt_minmax.cpp b/src/glsl/opt_minmax.cpp
index 32fb2d7ea2a..23d0b109d8b 100644
--- a/src/glsl/opt_minmax.cpp
+++ b/src/glsl/opt_minmax.cpp
@@ -133,6 +133,14 @@ compare_components(ir_constant *a, ir_constant *b)
else
foundequal = true;
break;
+ case GLSL_TYPE_DOUBLE:
+ if (a->value.d[c0] < b->value.d[c1])
+ foundless = true;
+ else if (a->value.d[c0] > b->value.d[c1])
+ foundgreater = true;
+ else
+ foundequal = true;
+ break;
default:
unreachable("not reached");
}
@@ -178,6 +186,11 @@ combine_constant(bool ismin, ir_constant *a, ir_constant *b)
(!ismin && b->value.f[i] > c->value.f[i]))
c->value.f[i] = b->value.f[i];
break;
+ case GLSL_TYPE_DOUBLE:
+ if ((ismin && b->value.d[i] < c->value.d[i]) ||
+ (!ismin && b->value.d[i] > c->value.d[i]))
+ c->value.d[i] = b->value.d[i];
+ break;
default:
assert(!"not reached");
}