aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_print_visitor.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-30 15:35:17 +0200
committermarha <marha@users.sourceforge.net>2013-08-30 15:35:17 +0200
commit5ebbc3a366287b631775ed3e17537580d380db8a (patch)
treef43c3d54e7c0e161c83288d83b22cbd7da49cc96 /mesalib/src/glsl/ir_print_visitor.cpp
parent84e570d071a041f85e2e8b92963d3390d14af5fc (diff)
downloadvcxsrv-5ebbc3a366287b631775ed3e17537580d380db8a.tar.gz
vcxsrv-5ebbc3a366287b631775ed3e17537580d380db8a.tar.bz2
vcxsrv-5ebbc3a366287b631775ed3e17537580d380db8a.zip
fontconfig mesa xserver xkeyboard-config xkbcomp git update 30 aug 2013
xserver commit 94d4e29aedc69431fa9b299ca1b67947173d7a24 xkeyboard-config commit fcb91cb1013cbdd87a6f77533f188d5934f24046 xkbcomp commit 24d18e0a844041ef82441adb16aa18cc4b4814ae fontconfig commit 071ce44c35733e54cb477cc75810cbe55025b619 mesa commit f7217b99f243738f941a5d009c68387dfadcb50a
Diffstat (limited to 'mesalib/src/glsl/ir_print_visitor.cpp')
-rw-r--r--mesalib/src/glsl/ir_print_visitor.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/mesalib/src/glsl/ir_print_visitor.cpp b/mesalib/src/glsl/ir_print_visitor.cpp
index 541231a33..b5183108d 100644
--- a/mesalib/src/glsl/ir_print_visitor.cpp
+++ b/mesalib/src/glsl/ir_print_visitor.cpp
@@ -406,7 +406,17 @@ void ir_print_visitor::visit(ir_constant *ir)
switch (ir->type->base_type) {
case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break;
case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break;
- case GLSL_TYPE_FLOAT: printf("%f", ir->value.f[i]); break;
+ case GLSL_TYPE_FLOAT:
+ 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)
+ printf("%a", ir->value.f[i]);
+ else if (abs(ir->value.f[i]) > 1000000.0f)
+ printf("%e", ir->value.f[i]);
+ else
+ printf("%f", ir->value.f[i]);
+ break;
case GLSL_TYPE_BOOL: printf("%d", ir->value.b[i]); break;
default: assert(0);
}