https://bugs.winehq.org/show_bug.cgi?id=51181
Bug ID: 51181 Summary: d3d10core:d3d10core fails systematically on AMD GPUs Product: Wine Version: 6.8 Hardware: x86-64 OS: Windows Status: NEW Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
test_instanced_draw() fails systematically in d3d10core:d3d10core on AMD GPUs (and sometimes there is a crash that follows):
d3d10core.c:9275: Test failed: Got 0xfff0f010, expected 0xff80f010 at (160, 0), sub-resource 0. d3d10core.c:9275: Test failed: Got 0xfff0f040, expected 0xff80f040 at (240, 0), sub-resource 0. d3d10core.c:9275: Test failed: Got 0xffaaaacc, expected 0xffbbaacc at (480, 0), sub-resource 0. d3d10core.c:9275: Test failed: Got 0xffaaaa90, expected 0xffbbaa90 at (560, 0), sub-resource 0.
Notice how this failure does not happen on the machines that have other GPUs such as cw-gtx560 or QEmu VMs, and how this does not depend on the Windows version or Radeon driver version for that matter:
https://test.winehq.org/data/patterns.html#d3d10core:d3d10core
So it looks like the test expects fails to account for the Radeon driver results for some reason.
The commit that introduced this test is:
commit fcd549345d96109179b125d31baf9e9073ecf643 Author: Józef Kucia jkucia@codeweavers.com AuthorDate: Mon Nov 6 10:55:20 2017 +0100 Commit: Alexandre Julliard julliard@winehq.org CommitDate: Mon Nov 6 19:37:09 2017 +0100
d3d10core/tests: Add test for SV_InstanceID.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=51181
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase Regression SHA1| |fcd549345d96109179b125d31ba | |f9e9073ecf643
https://bugs.winehq.org/show_bug.cgi?id=51181
--- Comment #1 from Henri Verbeet hverbeet@gmail.com --- Some comments:
- From the results, it looks like the affected configurations are mishandling the instance data step rate of "2", instead behaving as if it was "0". In principle that would warrant a broken(), but there's also a small chance it could be avoided by using a different vertex data format like DXGI_FORMAT_R8G8B8A8_UNORM instead of DXGI_FORMAT_R8_UNORM. If the latter works, that would probably be preferred.
- This test has a d3d11 equivalent, and the affected configurations are failing in the same way there.
- It's perhaps overly broad to say "AMD GPUs". At first sight, the only AMD results we have on test.winehq.org are the win*_cw-rx460-*, and win2009_fgtb-*-rx550-* results. The "rx460" appears to actually be an RX 560, but in any case, those are all AMD POLARIS cards. On the other hand, these are certainly succeeding on my AMD GPU here, and presumably they were for Józef when he wrote that test.
https://bugs.winehq.org/show_bug.cgi?id=51181
--- Comment #2 from François Gouget fgouget@codeweavers.com --- I applied the patch below but this did not change the failures.
--- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -9078,11 +9078,11 @@ static void test_instanced_draw(void) { {"position", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0}, - {"color", 0, DXGI_FORMAT_R8_UNORM, 1, D3D10_APPEND_ALIGNED_ELEMENT, + {"color", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_INSTANCE_DATA, 1}, - {"color", 1, DXGI_FORMAT_R8_UNORM, 2, D3D10_APPEND_ALIGNED_ELEMENT, + {"color", 1, DXGI_FORMAT_R8G8B8A8_UNORM, 2, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_INSTANCE_DATA, 0}, - {"color", 2, DXGI_FORMAT_R8_UNORM, 3, D3D10_APPEND_ALIGNED_ELEMENT, + {"color", 2, DXGI_FORMAT_R8G8B8A8_UNORM, 3, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_INSTANCE_DATA, 2}, {"v_offset", 0, DXGI_FORMAT_R32_FLOAT, 1, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_INSTANCE_DATA, 1},
https://bugs.winehq.org/show_bug.cgi?id=51181
--- Comment #3 from Henri Verbeet hverbeet@gmail.com --- (In reply to François Gouget from comment #2)
I applied the patch below but this did not change the failures.
You'd have to change the stream1/2/3[] arrays as well, to change the BYTE elements to DWORDs. (Currently the "stride" we pass in probably makes it mostly work, but it's not quite proper.)
One other thing that's perhaps worth a try is to run only the test_instanced_draw() tests (i.e., commenting out all the other queue_test() calls), and see if that makes a difference. It's not supposed to, but sometimes previous tests can get the driver into a (partially) broken state.
https://bugs.winehq.org/show_bug.cgi?id=51181
--- Comment #4 from François Gouget fgouget@codeweavers.com --- Created attachment 70209 --> https://bugs.winehq.org/attachment.cgi?id=70209 R8 -> R8G8B8A8 hack (try2)
I tried the bug51181_R8G8B8A8_v2.diff patch but that did not help.
https://bugs.winehq.org/show_bug.cgi?id=51181
--- Comment #5 from François Gouget fgouget@codeweavers.com --- Created attachment 70210 --> https://bugs.winehq.org/attachment.cgi?id=70210 Run test_instanced_draw() separately to avoid failures.
Further testing showed that: * Reproducing the failure is impossible if WINETEST_NO_MT_D3D=1. So this looks like a parallelism issue. * Reproducing the failure is still possible even if all the other tests are commented out except for test_il_append_aligned(). So the failure results from some bad interaction between these two tests.
So if we cannot find why test_il_append_aligned() and test_instanced_draw() cannot be run in parallel on cw-rx460, an option would be to run the latter after the other tests as is already done for test_stream_output_vs(). This is the purpose of the attached bug51181.diff patch.
https://bugs.winehq.org/show_bug.cgi?id=51181
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #6 from François Gouget fgouget@codeweavers.com --- There are still some intermittent failures and crashes on cw-rx460 but they are unrelated to this issue. So this apparently got fixed quite a while ago (before 2022-03-03).
https://bugs.winehq.org/show_bug.cgi?id=51181
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.8.