Wouldn't something like max(min(x, max(y,z)), min(y, z)) work as well,
saving one instruction?
Roland
Am 11.12.2013 08:52, schrieb Mario Rugiero:
> Why not computing the max3(min(x,y),min(x,z),min(y,z))?
>
> For the six possible cases:
> x < y < z --> max(x, x, y) -> y ==> works
> x < z < y -->
Why not computing the max3(min(x,y),min(x,z),min(y,z))?
For the six possible cases:
x < y < z --> max(x, x, y) -> y ==> works
x < z < y --> max(x, z, z) -> z ==> works
y < x < z --> max(y, x, y) -> x ==> works
y < z < x --> max(y, z, y) -> z ==> works
z < x < y --> max(x, z, z) -> x ==> works
z <
On 12/10/2013 02:43 PM, =?UTF-8?q?Maxence=20Le=20Dor=C3=A9?= wrote:
> ---
> src/glsl/builtin_functions.cpp | 44
> ++
> 1 file changed, 44 insertions(+)
>
> diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
> index 1f21a37..b9be
---
src/glsl/builtin_functions.cpp | 44 ++
1 file changed, 44 insertions(+)
diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index 1f21a37..b9beffd 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp