Commit graph

2256 commits

Author SHA1 Message Date
Zebediah Figura 221f110bbd wined3d: Remove no longer used arguments from wined3d_texture_update_desc().
Limit it to updating user memory and pitch.
2023-06-29 12:04:37 +02:00
Zebediah Figura ebaa0a9426 wined3d: Recreate swapchain textures in wined3d_swapchain_resize_buffers().
Instead of using wined3d_texture_update_desc(). This is safe, because:

* ddraw never exposes wined3d textures directly, and always retrieves them
  directly from wined3d when rendering.

* d3d8 and d3d9 (non-extended) will only resize buffers during a reset, and
  resetting is forbidden if the application holds any references to the
  backbuffers. RTVs are also replaced during a reset, so there is no concern
  about retrieving the old RTVs from the device state.

* d3d9ex allows resetting while holding references to the backbuffers, but tests
  (fixed by this patch) show that the backbuffers should in fact be recreated.

* dxgi forbids holding references to back buffers during ResizeBuffers(),
  including indirect references via command lists or device contexts.
2023-06-29 12:04:35 +02:00
Zebediah Figura f97163f4ea d3d9: Hold a reference to the wined3d swapchain from d3d9 swapchain surfaces. 2023-05-10 17:08:48 +02:00
Zebediah Figura eae8705184 d3d9/tests: Add some more tests for accessing an old backbuffer surface after a reset. 2023-05-10 17:08:48 +02:00
Zebediah Figura c7d8a1b47a wined3d: Directly call wined3d_texture_create() to create swapchain textures.
Get rid of the create_swapchain_texture callback.
2023-05-04 18:44:48 +02:00
Paul Gofman 8665935e2f wined3d: Add a comment about mismatched samplers. 2023-04-28 20:55:14 +02:00
Stefan Dösinger 4dce49594f d3d9/tests: Accept random depth when using a 3D texture with a 2D sampler. 2023-04-27 22:35:40 +02:00
Stefan Dösinger 32f6fcbf50 d3d9/tests: AMD GPUs sample the border color of cube textures. 2023-04-27 22:35:37 +02:00
Zebediah Figura ba99b0d77b d3d9: Pass the container to d3d9_surface_create(). 2023-04-26 22:49:17 +02:00
Zebediah Figura 7b7195330d d3d9: Create sub-resource surfaces manually.
Move away from using the sub_resource_created callback to do this.

This is also a step away from using the create_swapchain_texture callback.
2023-04-26 22:49:17 +02:00
Zebediah Figura 8a5b4252c8 d3d9: Move surface allocation to d3d9_surface_create().
Renamed from d3d9_surface_init() accordingly.
2023-04-26 22:49:17 +02:00
Stefan Dösinger 830906f3dc d3d9/tests: Accept AMD GPU sysmem sample failure in test_mipmap_upload. 2023-04-25 21:39:07 +02:00
Stefan Dösinger e5f149a81a d3d9/tests: Radeon GPUs don't draw from sysmem textures. 2023-04-25 21:39:07 +02:00
Stefan Dösinger 723cd0a4ae wined3d: Make video memory accounting a per-resource flag.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54701
2023-03-28 11:43:38 +02:00
Zebediah Figura 46c8a63752 winex11: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough. 2023-03-09 15:02:46 +01:00
Zebediah Figura ff752311cd d3d9/tests: Restore the focus window before sending SC_MAXIMIZE to it.
To match d3d8.

The original patch [1] claims

"WM_SIZE(SIZE_MAXIMIZED) is reliable here. The unreliable behavior
occured only with NOWINDOWCHANGES."

but this doesn't match my testing. Probably when that patch was submitted, this
very fix was applied to the d3d8 tests but forgotten for the d3d9 tests, and
then the wrong conclusions were drawn.

[1] https://www.winehq.org/pipermail/wine-patches/2014-December/135964.html
2023-03-03 11:17:02 +01:00
Illia Polishchuk af65f0c9a0 d3d9: Always draw only a single instance for non-indexed draws.
Windows d3d9 always draws only a single instance for non-indexed draws.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54570
2023-03-02 18:08:51 +01:00
Illia Polishchuk 6df6c7fe0c d3d9/tests: Add test for non-indexed instancing drawing.
Windows d3d9 always draws only a single instance for non-indexed draws.
2023-03-02 18:08:49 +01:00
Zebediah Figura 5535d834ee d3d9/tests: Test that presenting does not set the pixel format on a window without one. 2023-02-14 20:57:09 +01:00
Zebediah Figura d9c369c747 wined3d: Load and invalidate every mipmap level when mapping the top mipmap level.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53743
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
2023-01-06 10:40:20 +01:00
Zebediah Figura 2954d3e4a2 d3d9/tests: Test uploading the whole mipmap chain in one map.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
2023-01-06 10:40:19 +01:00
Alexandre Julliard 6a1e2c1b89 d3d9/tests: Fix some activation/focus test failures.
By backporting the corresponding window management tweaks from the
d3d8:device test.
2022-12-22 20:51:24 +01:00
Alexandre Julliard 1368a4c20b d3d9/tests: Mark a render target color test as todo.
Split the check_rt_color() function to allow conditional todos.
2022-12-22 20:51:24 +01:00
Alexandre Julliard 8bd9fcbdea d3d9/tests: Mark a texture sampling test as todo.
It fails on the Gitlab CI.
2022-12-22 20:51:24 +01:00
Zebediah Figura f3e381d1c9 d3d9: Upload the relevant texture in d3d9_texture_gen_auto_mipmap().
Instead of uploading all currently bound textures. Besides being redundant, this
would generate mipmaps for an uninitialized texture, and subsequently trying to
render from nonzero mipmap levels would yield uninitialized data.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54170
2022-12-21 18:24:39 +01:00
Zebediah Figura c3ee85b606 d3d9/tests: Test GenerateMipSubLevels() on a managed texture. 2022-12-21 18:24:39 +01:00
Alexandre Julliard 1efcbeacf1 d3d9/tests: Mark some of the depth bias tests as todo.
They fail on the Gitlab CI.
2022-12-19 22:25:19 +01:00
Alexandre Julliard ab8d0dafde d3d9/tests: Mark a zero-size pixel test as todo.
It fails on the Gitlab CI.
2022-12-19 22:25:19 +01:00
Alexandre Julliard d3fa1962a0 d3d9/tests: Mark a few more message tests as flaky. 2022-12-15 22:28:28 +01:00
Zebediah Figura ab0488d712 d3d9/tests: Do not test the alpha channel in test_multisample_get_front_buffer_data().
This avoids test failures on radeonsi.
2022-12-02 11:04:45 +01:00
Anton Baskanov c7f6dc641d wined3d: Introduce a new flag to indicate that indirect draws won't be used. 2022-11-14 13:13:01 +01:00
Zebediah Figura 9b3742bebb d3d9: Build without -DWINE_NO_LONG_TYPES. 2022-11-09 21:23:48 +01:00
Zebediah Figura 9b62f5e57f wined3d: Add a dirty rect to managed textures when resetting.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53798
2022-11-09 21:23:48 +01:00
Zebediah Figura e4cd936679 d3d9/tests: Test drawing from a managed texture after Reset(). 2022-11-09 21:23:48 +01:00
Paul Gofman 6b51935589 wined3d: Replace NULL device_window with focus window in swapchain desc. 2022-10-11 11:43:40 +02:00
Paul Gofman 832383f5cd d3d9/tests: Add test for NULL hDeviceWindow in presentation parameters. 2022-10-11 11:43:39 +02:00
Francois Gouget 61ee891c67 d3d9/tests: Mark the test_wndproc() tests failing randomly on Windows as flaky.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53281
2022-10-10 11:13:26 +02:00
Francois Gouget 42290cddc5 d3d9/tests: Mark the test_wndproc_windowed() tests failing randomly on Windows as flaky.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53283
2022-10-10 11:13:24 +02:00
Francois Gouget fc5bb4deef d3d9/tests: Mark the test_cursor_pos() tests failing randomly on Windows as flaky.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53194
2022-10-10 11:13:22 +02:00
Zebediah Figura 5f1cbb1b85 d3d9: Use a separate draw texture for managed resources.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52954
2022-09-27 18:14:34 +02:00
Zebediah Figura 2091bb34c2 d3d9: Add reference counting helpers for textures. 2022-09-27 18:14:33 +02:00
Zebediah Figura d5bb570542 d3d9: Introduce a d3d9_texture_preload() helper. 2022-09-27 18:14:33 +02:00
Zebediah Figura 46c9897bdf d3d9: Factor out d3d9_texture_init(). 2022-09-27 18:14:33 +02:00
Henri Verbeet bba63771eb d3d9/tests: The expected scissor rect after a reset is equal to the back-buffer dimensions.
This appears to have gotten lost in commit
7623d0a6f5.
2022-09-15 22:33:04 +02:00
Matteo Bruni 1f8431658e wined3d: Introduce WINED3DUSAGE_MANAGED.
We would like to use two different textures for the CPU and GPU parts of managed
textures, which means that wined3d_resource_access_is_managed() as such will no
longer be useful.
2022-08-16 22:27:53 +02:00
Zebediah Figura a3c4410fea d3d9: Introduce a wined3d_usage_from_d3d() helper. 2022-08-16 22:27:53 +02:00
Zebediah Figura bc7b188f55 d3d9/tests: Add tests for D3DLOCK_NO_DIRTY_UPDATE with vertex buffers. 2022-08-16 22:27:53 +02:00
Zebediah Figura a0eaae85a4 d3d9/tests: Add more tests for dirty rect handling. 2022-08-15 18:11:11 +02:00
Zebediah Figura 5a8075c945 d3d9/tests: Expand tests for valid pools in UpdateTexture(). 2022-08-15 18:11:10 +02:00
Zebediah Figura 0ee74e9f81 d3d9: Cache the output mode list.
Garou: Mark of the Wolves calls IDirect3D9::GetAdapterModeCount() on every
frame. This results in calling EnumDisplaySettingsExW() once per available mode,
which is a very slow operation, both on Windows and Wine.

Manual testing shows that Windows caches the mode list (as well as the adapter
list, which is already cached in Wine) in Direct3D 9 and lower. Calls to
GetAdapterModeCount() and EnumAdapterDisplayModes() are fast, and they also do
not change if monitors are added or removed.

DXGI behaves differently, however. The list of outputs attached to an adapter is
cached—that is, calls to IDXGIAdapter::EnumOutputs() are fast, and return stale
data. However, at least some other calls are slow and do not seem to be cached,
including IDXGIOutput::GetDisplayModeList() and IDXGIOutput::GetDesc().

ddraw is also slow and uncached. Since all testing was done on Windows 10 (for
lack of available older hardware to test with) it is not unlikely that ddraw was
reimplemented over dxgi on newer Windows, and that older Windows versions would
be fast and cached, but this is speculation. In any case I have not included
patches to cache ddraw modes.

Tests were done on Windows 10 21H2, both on real hardware with NVidia drivers
and on software drivers via qemu/KVM. In the latter case only speed could be
tested, but this was consistent with the results from the NVidia machine.
2022-08-02 21:49:54 +02:00