diff --git a/internal/shader/testdata/issue1245.expected.fs b/internal/shader/testdata/issue1245.expected.fs index 60c2b318d..c24d63cd3 100644 --- a/internal/shader/testdata/issue1245.expected.fs +++ b/internal/shader/testdata/issue1245.expected.fs @@ -1,7 +1,7 @@ void main(void) { vec4 l0 = vec4(0); for (float l1 = 0.0; l1 < 4.0; l1++) { - (l0).x = ((l0).x) + ((l1) * (1.000000000e-02)); + (l0).x = ((l0).x) + ((l1) * (1.0000000000e-02)); } gl_FragColor = l0; return; diff --git a/internal/shader/testdata/issue1245.expected.vs b/internal/shader/testdata/issue1245.expected.vs index 988724832..1514fa55d 100644 --- a/internal/shader/testdata/issue1245.expected.vs +++ b/internal/shader/testdata/issue1245.expected.vs @@ -3,7 +3,7 @@ attribute vec2 A0; void main(void) { vec4 l0 = vec4(0); for (float l1 = 0.0; l1 < 4.0; l1++) { - (l0).x = ((l0).x) + ((l1) * (1.000000000e-02)); + (l0).x = ((l0).x) + ((l1) * (1.0000000000e-02)); } gl_Position = l0; return; diff --git a/internal/shader/testdata/number_binary.expected.vs b/internal/shader/testdata/number_binary.expected.vs index 30cb9d236..8747b73be 100644 --- a/internal/shader/testdata/number_binary.expected.vs +++ b/internal/shader/testdata/number_binary.expected.vs @@ -7,9 +7,9 @@ void F0(out vec4 l0) { float l3 = float(0); float l4 = float(0); l1 = 2; - l2 = 2.500000000e+00; - l3 = 2.500000000e+00; - l4 = 2.500000000e+00; + l2 = 2.5000000000e+00; + l3 = 2.5000000000e+00; + l4 = 2.5000000000e+00; l0 = vec4(l1, l2, l3, l4); return; } @@ -20,9 +20,9 @@ void F1(out vec4 l0) { float l3 = float(0); float l4 = float(0); l1 = 2; - l2 = 2.500000000e+00; - l3 = 2.500000000e+00; - l4 = 2.500000000e+00; + l2 = 2.5000000000e+00; + l3 = 2.5000000000e+00; + l4 = 2.5000000000e+00; l0 = vec4(l1, l2, l3, l4); return; } diff --git a/internal/shaderir/glsl/glsl.go b/internal/shaderir/glsl/glsl.go index 4b45b392a..2855b0109 100644 --- a/internal/shaderir/glsl/glsl.go +++ b/internal/shaderir/glsl/glsl.go @@ -262,7 +262,7 @@ func constantToNumberLiteral(t shaderir.ConstType, v constant.Value) string { } if i := constant.ToFloat(v); i.Kind() == constant.Float { x, _ := constant.Float64Val(i) - return fmt.Sprintf("%.9e", x) + return fmt.Sprintf("%.10e", x) } case shaderir.ConstTypeInt: if i := constant.ToInt(v); i.Kind() == constant.Int { diff --git a/internal/shaderir/metal/metal.go b/internal/shaderir/metal/metal.go index ed99227cf..6136ab226 100644 --- a/internal/shaderir/metal/metal.go +++ b/internal/shaderir/metal/metal.go @@ -268,7 +268,7 @@ func constantToNumberLiteral(t shaderir.ConstType, v constant.Value) string { } if i := constant.ToFloat(v); i.Kind() == constant.Float { x, _ := constant.Float64Val(i) - return fmt.Sprintf("%.9e", x) + return fmt.Sprintf("%.10e", x) } case shaderir.ConstTypeInt: if i := constant.ToInt(v); i.Kind() == constant.Int {