On 02/07/2014 05:45 AM, Erik Faye-Lund wrote:
Signed-off-by: Erik Faye-Lund <kusmab...@gmail.com>
---
  src/gallium/auxiliary/tgsi/tgsi_exec.c | 26 ++++----------------------
  1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c 
b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 3d37eaa..96809cd 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -914,28 +914,10 @@ micro_rcc(union tgsi_exec_channel *dst,
     for (i = 0; i < 4; i++) {
        float recip = 1.0f / src->f[i];

-      if (recip > 0.0f) {
-         if (recip > 1.884467e+019f) {
-            dst->f[i] = 1.884467e+019f;
-         }
-         else if (recip < 5.42101e-020f) {
-            dst->f[i] = 5.42101e-020f;
-         }
-         else {
-            dst->f[i] = recip;
-         }
-      }
-      else {
-         if (recip < -1.884467e+019f) {
-            dst->f[i] = -1.884467e+019f;
-         }
-         else if (recip > -5.42101e-020f) {
-            dst->f[i] = -5.42101e-020f;
-         }
-         else {
-            dst->f[i] = recip;
-         }
-      }
+      if (recip > 0.0f)
+         dst->f[i] = CLAMP(recip, 5.42101e-020f, 1.884467e+019f);
+      else
+         dst->f[i] = CLAMP(recip, -1.884467e+019f, -5.42101e-020f);
     }
  }



For both, Reviewed-by: Brian Paul <bri...@vmware.com>

Thanks.

Do you need me to push these for you?

-Brian

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to