Previously, depending on how the sin() was calculated, we could get a small number or exactly 0, which unfortunately can be pretty far between in terms of ULPs. We don't really want to test edge-case accuracy with trig functions in the first place, so just nudge the angle away from exact values.
From: Matteo Bruni mbruni@codeweavers.com
Previously, depending on how the sin() was calculated, we could get a small number or exactly 0, which unfortunately can be pretty far between in terms of ULPs. We don't really want to test edge-case accuracy with trig functions in the first place, so just nudge the angle away from exact values. --- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 2ba4b50c924..990c95be70d 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -707,9 +707,9 @@ static void test_trig(void) init_readback(device, &rb); for (i = 0; i < 32; ++i) { - float expect_x = (sinf(i * 2 * M_PI / 32) + 1.0f) / 2.0f; - float expect_y = (cosf(i * 2 * M_PI / 32) + 1.0f) / 2.0f; - v = get_readback_vec4(&rb, i * 640 / 32, 0); + float expect_x = (sinf((i + 0.5f) * 2.0f * M_PI / 32) + 1.0f) / 2.0f; + float expect_y = (cosf((i + 0.5f) * 2.0f * M_PI / 32) + 1.0f) / 2.0f; + v = get_readback_vec4(&rb, i * 640 / 32 + 640 / 2 / 32, 0); ok(compare_vec4(v, expect_x, expect_y, 0.0f, 0.0f, 4096), "Test %u: Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", i, v->x, v->y, v->z, v->w, expect_x, expect_y, 0.0f, 0.0f);
This merge request was approved by Matteo Bruni.