Commit graph

1717 commits

Author SHA1 Message Date
Stefan Dösinger 763dc06450 d3d8/tests: Don't check messages when doing the minimization workaround dance. 2023-09-08 11:29:22 +02:00
Alexandre Julliard 20afe43832 Remove unused NONAMELESS defines. 2023-08-15 18:56:45 +02:00
Alexandre Julliard 8d86c6d9d9 d3d8/tests: Use nameless unions/structs. 2023-08-15 18:56:45 +02:00
Jeff Smith f6f25c5ed1 d3d8/tests: Use compare_uint() in compare_float() instead of abs().
The result of abs(INT_MIN) is INT_MIN, which breaks the ulps comparison.
2023-08-10 09:52:38 +09:00
Zebediah Figura 5323042f7a wined3d: Add helpers to retrieve shader constants from a wined3d_stateblock. 2023-07-27 11:54:21 +09:00
Alistair Leslie-Hughes 6f8be72bd8 d3d8: Remove DECLSPEC_HIDDEN usage. 2023-07-11 22:39:35 +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
Sebastian Mayr 7a2b34c324 wined3d: Improve d3d8 compatibility of texture filters.
In d3d8, setting texture filters to invalid values does not yield an
error when calling IDirect3DDevice8::ValidateDevice. Some applications,
such as Worms Blast, rely on this behaviour.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54898
2023-05-18 15:40:17 -05:00
Sebastian Mayr 38f3f83943 d3d8/tests: Test IDirect3DDevice8::ValidateDevice() with various min, mag and mip filters.
This test is an adaptation of the corresponding d3d9 test.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54898
2023-05-18 15:40:14 -05:00
Zebediah Figura 3ba9a7f7b4 d3d8: Hold a reference to the wined3d swapchain from d3d8 swapchain surfaces. 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
Zebediah Figura fd3d4d0a93 d3d8: Pass the container to d3d8_surface_create(). 2023-05-04 18:44:48 +02:00
Zebediah Figura 9a6d889b41 d3d8: Create sub-resource surfaces manually. 2023-05-04 18:44:48 +02:00
Zebediah Figura e0828a70b2 d3d8: Move surface allocation to d3d8_surface_create().
Renamed from d3d8_surface_init() accordingly.
2023-05-04 18:44:46 +02:00
Stefan Dösinger 60adbec765 d3d8/test: Accept AMD GPU sysmem sample failure in test_mipmap_upload. 2023-04-25 21:39:07 +02:00
Stefan Dösinger e39c497559 d3d8/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
Francois Gouget d3c32ccfe1 d3d8/tests: Remove an unused call to IDirect3D8_GetAdapterDisplayMode().
It is no longer used now that test_fpu_setup() uses create_device().
2023-03-14 18:34:34 +01: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 45f69f73bf d3d8/tests: Do not check for WM_MOVE in sc_maximize_messages. 2023-03-03 11:17:02 +01:00
Zebediah Figura 5287d375a6 d3d8/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 379ae701c0 d3d8: Filter out redundant buffer discards.
I was unable to write tests for this; it seems it doesn't consistently work on
Windows. However, Rayman 3 seems to rely on it; it maps the same buffer twice
immediately after creation, with DISCARD flags on both maps, and expects the
same address to be returned.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53752
2023-01-06 13:39:45 +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 798b23d971 d3d8/tests: Test uploading the whole mipmap chain in one map.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
2023-01-06 10:40:20 +01:00
Alexandre Julliard 9761191f1c d3d8/tests: Make sure that the window has focus before testing loss of focus. 2022-12-20 22:37:02 +01:00
Alexandre Julliard 971ef0d3b3 d3d8/tests: Don't require WM_MOVE on window reactivation.
It can be activated without moving.
2022-12-20 22:37:02 +01:00
Alexandre Julliard 28eafda808 d3d8/tests: Mark a zero-size pixel test as todo.
It fails on the Gitlab CI.
2022-12-19 22:25:19 +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 52c35814be d3d8: 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 e4d37a452f d3d8/tests: Test drawing from a managed texture after Reset(). 2022-11-09 21:23:48 +01:00
Paul Gofman 4d4a4ff5b9 d3d8/tests: Add test for NULL hDeviceWindow in presentation parameters. 2022-10-11 11:43:39 +02:00
Zebediah Figura ec6b6f38be d3d8: Use a separate draw texture for managed resources. 2022-10-10 11:03:57 +02:00
Zebediah Figura 520daf8630 d3d8: Add reference counting helpers for textures. 2022-10-10 11:03:57 +02:00
Zebediah Figura 99cee90c19 d3d8: Introduce a d3d8_texture_preload() helper. 2022-10-10 11:03:57 +02:00
Zebediah Figura a72e2613ae d3d8: Factor out d3d8_texture_init(). 2022-10-10 11:03:57 +02:00
Zebediah Figura 3178e9095b wined3d: Add a dirty region to the destination texture in wined3d_device_context_blt() if applicable. 2022-09-13 22:07:22 +02:00
Zebediah Figura fdd8c0748b d3d8: Remove an incorrect comment.
This was probably added on the assumption that
IDirect3DDevice8::CopyRects() behaves like the similar
IDirect3DDevice9::UpdateSurface(), but it does not.
2022-09-13 22:07:22 +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 6db6df95dc d3d8: Introduce a wined3d_usage_from_d3d() helper. 2022-08-16 22:27:53 +02:00
Zebediah Figura ae05de2c4f d3d8/tests: Add tests for D3DLOCK_NO_DIRTY_UPDATE with vertex buffers. 2022-08-16 22:27:53 +02:00
Zebediah Figura ddfd9ea5ab d3d8/tests: Add more tests for dirty rect handling. 2022-08-15 18:11:11 +02:00
Zebediah Figura 01baee8c60 d3d8/tests: Read back directly from the specified surface if possible. 2022-08-15 18:11:11 +02:00
Zebediah Figura c90c226c16 d3d8/tests: Expand tests for valid pools in UpdateTexture(). 2022-08-15 18:11:10 +02:00
Zebediah Figura b42aa9b87b d3d8: Cache the output mode list. 2022-08-02 21:49:54 +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
Zebediah Figura 7341eb3037 d3d8: Do not release the wined3d mutex in d3d8_device_upload_sysmem_index_buffer().
Spotted by Henri Verbeet.

This fixes a regression introduced by fc0f0090f6.
2022-07-27 23:07:06 +02:00
Zebediah Figura 764537c0c1 d3d8: Correctly check for sysmem index buffers in d3d8_device_ApplyStateBlock().
This fixes a regression introduced by fc0f0090f6.
2022-07-27 23:07:06 +02:00
Zebediah Figura 50b67f9818 d3d8/tests: Use a nonzero start index in test_sysmem_draw().
This uncovered a bug in the previous patch.
2022-07-13 15:03:45 +02:00
Zebediah Figura fc0f0090f6 d3d8: Upload sysmem vertex buffers into the streaming buffer in d3d8_device_DrawPrimitive().
Bloodrayne: Terminal Cut (and Bloodrayne 2: Terminal Cut, and probably other
games in the series) streams from a SYSTEMMEM index buffer, updating it and
drawing from it every frame. This is currently slow on Wine, since each map
needs to wait for the previous upload (on the CS) to complete.

There are a few ways to avoid waiting, but this patch takes the approach of
effectively uploading from the SYSTEMMEM buffer on the client side, while using
a dynamic buffer to avoid client/CS synchronization. This brings performance
from 20-30 FPS to a (locked) 60, on NVidia GL drivers.
2022-07-13 15:03:40 +02:00