Take absolute value of value for fast_length().
Bug: 9018865
Change-Id: I3f6539a4f97d0b1276341adc0752ce510f13cda5
diff --git a/driver/runtime/rs_cl.c b/driver/runtime/rs_cl.c
index c0543de..b7f9158 100755
--- a/driver/runtime/rs_cl.c
+++ b/driver/runtime/rs_cl.c
@@ -931,7 +931,7 @@
extern float __attribute__((overloadable)) half_sqrt(float);
extern float __attribute__((overloadable)) fast_length(float v) {
- return v;
+ return fabs(v);
}
extern float __attribute__((overloadable)) fast_length(float2 v) {
return half_sqrt(v.x*v.x + v.y*v.y);