diff options
author | Connor Abbott <[email protected]> | 2014-05-27 21:23:02 -0400 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-05-28 15:05:59 -0700 |
commit | bbaec0f76c714a369014a47cca588fa3c2c9ce1e (patch) | |
tree | 7bc6935190d4981e38e1097d0172cb0a0da47d7c /src/glsl/ir_print_visitor.cpp | |
parent | a7aca3919ba29ccdac01136fa9ba79f571bc797d (diff) |
glsl: be more consistent about printing constants
Make sure that we print the same number of digits when printing 0.0 as
any other floating-point number. This will make generating expected
output files for tests easier. To avoid breaking "make check," update
the generated tests for lower_jumps before the next commit which will
bring create_test_cases.py in line with them.
Signed-off-by: Connor Abbott <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/ir_print_visitor.cpp')
-rw-r--r-- | src/glsl/ir_print_visitor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index 418f0515153..c4a6f9c9f1c 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -430,7 +430,7 @@ void ir_print_visitor::visit(ir_constant *ir) case GLSL_TYPE_FLOAT: if (ir->value.f[i] == 0.0f) /* 0.0 == -0.0, so print with %f to get the proper sign. */ - fprintf(f, "%.1f", ir->value.f[i]); + fprintf(f, "%f", ir->value.f[i]); else if (fabs(ir->value.f[i]) < 0.000001f) fprintf(f, "%a", ir->value.f[i]); else if (fabs(ir->value.f[i]) > 1000000.0f) |