projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8814806
)
glsl: Use fabs() on floating point values.
author
Matt Turner
<mattst88@gmail.com>
Tue, 26 Nov 2013 06:18:28 +0000
(22:18 -0800)
committer
Matt Turner
<mattst88@gmail.com>
Thu, 5 Dec 2013 04:05:43 +0000
(20:05 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_print_visitor.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ir_print_visitor.cpp
b/src/glsl/ir_print_visitor.cpp
index f85e573c43e43e548f1d2cb8887110574a5d1c3c..6ad22fe33e8de32dece4d802917ea9273210e8a3 100644
(file)
--- a/
src/glsl/ir_print_visitor.cpp
+++ b/
src/glsl/ir_print_visitor.cpp
@@
-416,9
+416,9
@@
void ir_print_visitor::visit(ir_constant *ir)
if (ir->value.f[i] == 0.0f)
/* 0.0 == -0.0, so print with %f to get the proper sign. */
printf("%.1f", ir->value.f[i]);
- else if (abs(ir->value.f[i]) < 0.000001f)
+ else if (
f
abs(ir->value.f[i]) < 0.000001f)
printf("%a", ir->value.f[i]);
- else if (abs(ir->value.f[i]) > 1000000.0f)
+ else if (
f
abs(ir->value.f[i]) > 1000000.0f)
printf("%e", ir->value.f[i]);
else
printf("%f", ir->value.f[i]);