[PATCH 0/1] MR3694: d3dcompiler/tests: Avoid interpolation filters in test_samplers().
To avoid accuracy issues, specifically with the QXL driver. In preparation of the next vkd3d merge when these tests will start to work in Wine. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3694
From: Matteo Bruni <mbruni(a)codeweavers.com> --- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 42fb3b97fc2..c72aea3d024 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -1115,33 +1115,33 @@ static void test_samplers(void) "sampler s;\n" "float4 main() : COLOR\n" "{\n" - " return tex2D(s, float2(0.5, 0.5));\n" + " return tex2D(s, float2(0.75, 0.25));\n" "}", "SamplerState s;\n" "float4 main() : COLOR\n" "{\n" - " return tex2D(s, float2(0.5, 0.5));\n" + " return tex2D(s, float2(0.75, 0.25));\n" "}", "sampler2D s;\n" "float4 main() : COLOR\n" "{\n" - " return tex2D(s, float2(0.5, 0.5));\n" + " return tex2D(s, float2(0.75, 0.25));\n" "}", "sampler s;\n" "Texture2D t;\n" "float4 main() : COLOR\n" "{\n" - " return t.Sample(s, float2(0.5, 0.5));\n" + " return t.Sample(s, float2(0.75, 0.25));\n" "}", "SamplerState s;\n" "Texture2D t;\n" "float4 main() : COLOR\n" "{\n" - " return t.Sample(s, float2(0.5, 0.5));\n" + " return t.Sample(s, float2(0.75, 0.25));\n" "}", }; @@ -1161,7 +1161,7 @@ static void test_samplers(void) hr = IDirect3DDevice9_SetTexture(test_context.device, 0, (IDirect3DBaseTexture9 *)texture); ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - hr = IDirect3DDevice9_SetSamplerState(test_context.device, 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); + hr = IDirect3DDevice9_SetSamplerState(test_context.device, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT); ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -1174,7 +1174,7 @@ static void test_samplers(void) draw_quad(test_context.device, ps_code); v = get_color_vec4(test_context.device, 0, 0); - todo_wine ok(compare_vec4(&v, 0.25f, 0.0f, 0.25f, 0.0f, 128), + todo_wine ok(compare_vec4(&v, 1.0f, 0.0f, 1.0f, 0.0f, 0), "Test %u: Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", i, v.x, v.y, v.z, v.w); ID3D10Blob_Release(ps_code); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3694
I guess, but we do test linear filtering in vkd3d, so it's not like this thoroughly avoids the issue. Just how inaccurate is QXL? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3694#note_43976
On Thu Aug 31 17:51:27 2023 +0000, Zebediah Figura wrote:
I guess, but we do test linear filtering in vkd3d, so it's not like this thoroughly avoids the issue. Just how inaccurate is QXL? 256K ULPs, which is crazy to me. See https://gitlab.winehq.org/wine/wine/-/merge_requests/3172#note_43940
Assuming there isn't some other explanation for the huge discrepancy, I think we should simply consider QXL not a suitable test platform. In this particular case, though, testing filtered sampling is not the point, while testing shader translation is, and the updated test does a better job of that as well IMO. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3694#note_43979
This merge request was approved by Matteo Bruni. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3694
On Thu Aug 31 17:51:27 2023 +0000, Matteo Bruni wrote:
256K ULPs, which is crazy to me. See https://gitlab.winehq.org/wine/wine/-/merge_requests/3172#note_43940 Assuming there isn't some other explanation for the huge discrepancy, I think we should simply consider QXL not a suitable test platform. In this particular case, though, testing filtered sampling is not the point, while testing shader translation is, and the updated test does a better job of that as well IMO. Oh, ha ha, you know what it is? QXL is giving us 2.47058839e-001, and:
```
0x3f / 0xff 0.24705882352941178
It's rendering into an R8G8B8A8_UNORM render target and then converting that *back* to float. That can't possibly be in spec.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3694#note_43987
On Thu Aug 31 18:29:16 2023 +0000, Zebediah Figura wrote:
Oh, ha ha, you know what it is? QXL is giving us 2.47058839e-001, and: ```
0x3f / 0xff 0.24705882352941178
It's rendering into an R8G8B8A8_UNORM render target and then converting that *back* to float. That can't possibly be in spec. That's 100% it :rolling_eyes:
But yeah, that's what I mean when I say that d3d QXL test results ought to be ignored. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3694#note_43988
participants (3)
-
Matteo Bruni -
Matteo Bruni (@Mystral) -
Zebediah Figura (@zfigura)