Generic template and forward in stringstream.
This CL updates the templates in the StringStream to match more types.
All of the internal `operator<<` methods have been converted over to
StringStream. The precision was increased in order to better match the
precision needed to read back as a double.
Bug: tint:1686
Change-Id: Iaa15cf247f174967dd1014647ba5a74804997c22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122080
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
diff --git a/test/tint/samples/compute_boids.wgsl.expected.dxc.hlsl b/test/tint/samples/compute_boids.wgsl.expected.dxc.hlsl
index e4d736d..5c07332 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.dxc.hlsl
+++ b/test/tint/samples/compute_boids.wgsl.expected.dxc.hlsl
@@ -86,7 +86,7 @@
cVel = (cVel / float2(float(cVelCount), float(cVelCount)));
}
vVel = (((vVel + (cMass * asfloat(params[1].x))) + (colVel * asfloat(params[1].y))) + (cVel * asfloat(params[1].z)));
- vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.100000001f));
+ vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.10000000149011611938f));
vPos = (vPos + (vVel * asfloat(params[0].x)));
if ((vPos.x < -1.0f)) {
vPos.x = 1.0f;
diff --git a/test/tint/samples/compute_boids.wgsl.expected.fxc.hlsl b/test/tint/samples/compute_boids.wgsl.expected.fxc.hlsl
index e4d736d..5c07332 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.fxc.hlsl
+++ b/test/tint/samples/compute_boids.wgsl.expected.fxc.hlsl
@@ -86,7 +86,7 @@
cVel = (cVel / float2(float(cVelCount), float(cVelCount)));
}
vVel = (((vVel + (cMass * asfloat(params[1].x))) + (colVel * asfloat(params[1].y))) + (cVel * asfloat(params[1].z)));
- vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.100000001f));
+ vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.10000000149011611938f));
vPos = (vPos + (vVel * asfloat(params[0].x)));
if ((vPos.x < -1.0f)) {
vPos.x = 1.0f;
diff --git a/test/tint/samples/compute_boids.wgsl.expected.glsl b/test/tint/samples/compute_boids.wgsl.expected.glsl
index 9cc783d..5ce44e5 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.glsl
+++ b/test/tint/samples/compute_boids.wgsl.expected.glsl
@@ -143,7 +143,7 @@
cVel = (cVel / vec2(float(cVelCount), float(cVelCount)));
}
vVel = (((vVel + (cMass * params.inner.rule1Scale)) + (colVel * params.inner.rule2Scale)) + (cVel * params.inner.rule3Scale));
- vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.100000001f));
+ vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.10000000149011611938f));
vPos = (vPos + (vVel * params.inner.deltaT));
if ((vPos.x < -1.0f)) {
vPos.x = 1.0f;
diff --git a/test/tint/samples/compute_boids.wgsl.expected.msl b/test/tint/samples/compute_boids.wgsl.expected.msl
index 3a8d9cc..dd67382 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.msl
+++ b/test/tint/samples/compute_boids.wgsl.expected.msl
@@ -110,7 +110,7 @@
cVel = (cVel / float2(float(cVelCount), float(cVelCount)));
}
vVel = (((vVel + (cMass * (*(tint_symbol_5)).rule1Scale)) + (colVel * (*(tint_symbol_5)).rule2Scale)) + (cVel * (*(tint_symbol_5)).rule3Scale));
- vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.100000001f));
+ vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.10000000149011611938f));
vPos = (vPos + (vVel * (*(tint_symbol_5)).deltaT));
if ((vPos[0] < -1.0f)) {
vPos[0] = 1.0f;
diff --git a/test/tint/samples/compute_boids.wgsl.expected.wgsl b/test/tint/samples/compute_boids.wgsl.expected.wgsl
index fd43650..e7e3d62 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.wgsl
+++ b/test/tint/samples/compute_boids.wgsl.expected.wgsl
@@ -75,7 +75,7 @@
cVel = (cVel / vec2<f32>(f32(cVelCount), f32(cVelCount)));
}
vVel = (((vVel + (cMass * params.rule1Scale)) + (colVel * params.rule2Scale)) + (cVel * params.rule3Scale));
- vVel = (normalize(vVel) * clamp(length(vVel), 0.0, 0.1));
+ vVel = (normalize(vVel) * clamp(length(vVel), 0.0, 0.10000000000000000555));
vPos = (vPos + (vVel * params.deltaT));
if ((vPos.x < -(1.0))) {
vPos.x = 1.0;
diff --git a/test/tint/samples/function.wgsl.expected.dxc.hlsl b/test/tint/samples/function.wgsl.expected.dxc.hlsl
index 8073117..f8dc23c 100644
--- a/test/tint/samples/function.wgsl.expected.dxc.hlsl
+++ b/test/tint/samples/function.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
float main() {
- return 0.400000006f;
+ return 0.40000000596046447754f;
}
[numthreads(2, 1, 1)]
diff --git a/test/tint/samples/function.wgsl.expected.fxc.hlsl b/test/tint/samples/function.wgsl.expected.fxc.hlsl
index 8073117..f8dc23c 100644
--- a/test/tint/samples/function.wgsl.expected.fxc.hlsl
+++ b/test/tint/samples/function.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
float main() {
- return 0.400000006f;
+ return 0.40000000596046447754f;
}
[numthreads(2, 1, 1)]
diff --git a/test/tint/samples/function.wgsl.expected.msl b/test/tint/samples/function.wgsl.expected.msl
index 6c3ffad..43d2a28 100644
--- a/test/tint/samples/function.wgsl.expected.msl
+++ b/test/tint/samples/function.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
float tint_symbol() {
- return 0.400000006f;
+ return 0.40000000596046447754f;
}
kernel void ep() {
diff --git a/test/tint/samples/simple.wgsl.expected.dxc.hlsl b/test/tint/samples/simple.wgsl.expected.dxc.hlsl
index f47bf23..5259446 100644
--- a/test/tint/samples/simple.wgsl.expected.dxc.hlsl
+++ b/test/tint/samples/simple.wgsl.expected.dxc.hlsl
@@ -8,7 +8,7 @@
float4 main_inner() {
float2 a = (0.0f).xx;
bar();
- return float4(0.400000006f, 0.400000006f, 0.800000012f, 1.0f);
+ return float4(0.40000000596046447754f, 0.40000000596046447754f, 0.80000001192092895508f, 1.0f);
}
tint_symbol main() {
diff --git a/test/tint/samples/simple.wgsl.expected.fxc.hlsl b/test/tint/samples/simple.wgsl.expected.fxc.hlsl
index f47bf23..5259446 100644
--- a/test/tint/samples/simple.wgsl.expected.fxc.hlsl
+++ b/test/tint/samples/simple.wgsl.expected.fxc.hlsl
@@ -8,7 +8,7 @@
float4 main_inner() {
float2 a = (0.0f).xx;
bar();
- return float4(0.400000006f, 0.400000006f, 0.800000012f, 1.0f);
+ return float4(0.40000000596046447754f, 0.40000000596046447754f, 0.80000001192092895508f, 1.0f);
}
tint_symbol main() {
diff --git a/test/tint/samples/simple.wgsl.expected.glsl b/test/tint/samples/simple.wgsl.expected.glsl
index 3e4dabe..744aeba 100644
--- a/test/tint/samples/simple.wgsl.expected.glsl
+++ b/test/tint/samples/simple.wgsl.expected.glsl
@@ -8,7 +8,7 @@
vec4 tint_symbol() {
vec2 a = vec2(0.0f);
bar();
- return vec4(0.400000006f, 0.400000006f, 0.800000012f, 1.0f);
+ return vec4(0.40000000596046447754f, 0.40000000596046447754f, 0.80000001192092895508f, 1.0f);
}
void main() {
diff --git a/test/tint/samples/simple.wgsl.expected.msl b/test/tint/samples/simple.wgsl.expected.msl
index d84f872..5527033 100644
--- a/test/tint/samples/simple.wgsl.expected.msl
+++ b/test/tint/samples/simple.wgsl.expected.msl
@@ -11,7 +11,7 @@
float4 tint_symbol_inner() {
float2 a = float2(0.0f);
bar();
- return float4(0.400000006f, 0.400000006f, 0.800000012f, 1.0f);
+ return float4(0.40000000596046447754f, 0.40000000596046447754f, 0.80000001192092895508f, 1.0f);
}
fragment tint_symbol_1 tint_symbol() {
diff --git a/test/tint/samples/simple.wgsl.expected.wgsl b/test/tint/samples/simple.wgsl.expected.wgsl
index cf8998d..b5993e6 100644
--- a/test/tint/samples/simple.wgsl.expected.wgsl
+++ b/test/tint/samples/simple.wgsl.expected.wgsl
@@ -5,5 +5,5 @@
fn main() -> @location(0) vec4<f32> {
var a : vec2<f32> = vec2<f32>();
bar();
- return vec4<f32>(0.4, 0.4, 0.8, 1.0);
+ return vec4<f32>(0.4000000000000000222, 0.4000000000000000222, 0.80000000000000004441, 1.0);
}