Commit graph

2859 commits

Author SHA1 Message Date
Zebediah Figura 53aa0be037 ddraw: Move sub-resource surface initialization to ddraw_surface_create_wined3d_texture(). 2023-03-14 14:24:59 +01:00
Zebediah Figura 54fb279302 ddraw: Factor out more common initialization into ddraw_surface_create_wined3d_texture(). 2023-03-14 14:24:59 +01:00
Zebediah Figura 7a61760c60 ddraw: Move sysmem_fallback setting to ddraw_surface_create_wined3d_texture(). 2023-03-14 14:24:59 +01:00
Zebediah Figura fbcd01ff1f ddraw: Remove some outdated comments from ddraw_surface7_SetSurfaceDesc(). 2023-03-14 14:24:59 +01:00
Zebediah Figura 0fb06e8ac7 ddraw: Rename "is_complex_root" to "is_root".
"is_complex_root" is somewhat misleading, given that it is TRUE for surfaces with no attached surfaces.
2023-03-14 14:24:59 +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 b826e1eb3d ddraw: Move wined3d_resource_desc translation to ddraw_surface_create_wined3d_texture(). 2023-03-08 18:07:04 +01:00
Zebediah Figura eea1b79e24 ddraw: Move the wined3d_texture_update_desc() call into ddraw_surface_create_wined3d_texture(). 2023-03-08 18:07:04 +01:00
Zebediah Figura b15339d470 ddraw: Restructure ddraw_surface_create_wined3d_texture() to avoid gotos.
And, more saliently, to allow moving more common code to the end of the
function.
2023-03-08 18:07:03 +01:00
Zebediah Figura 5ba3c4af7c ddraw: Separate a need_draw_texture() helper. 2023-03-08 18:07:03 +01:00
Zebediah Figura 655af198df ddraw: Move pitch validation to ddraw_surface_create_wined3d_texture().
It makes use of the wined3d_format, and we want to move wined3d desc creation to
ddraw_surface_create_wined3d_texture() so that we can use it to recreate the
wined3d texture in SetSurfaceDesc().
2023-03-08 18:07:01 +01:00
Zebediah Figura 2f3c7e8725 ddraw: Remove the redundant "desc" parameter to ddraw_surface_create_wined3d_texture(). 2023-03-02 19:43:08 +01:00
Zebediah Figura c86263aa5d ddraw: Forbid DDSD_MIPMAPCOUNT without DDSCAPS_COMPLEX. 2023-03-02 19:43:07 +01:00
Zebediah Figura 9bfdd9141c ddraw: Forbid DDSCAPS_COMPLEX without any caps that merit a complex surface. 2023-03-02 19:43:07 +01:00
Zebediah Figura df8c73e906 ddraw/tests: Add more tests for mipmap surface creation flags. 2023-03-02 19:43:07 +01:00
Zebediah Figura 1cea45a183 ddraw/tests: Test that surface properties are retained across SetSurfaceDesc() calls. 2023-03-02 19:43:07 +01:00
Zebediah Figura 89e68fa9c9 ddraw/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 02b482f47b ddraw/tests: Remove unnecessary skips and conditionals from test_pixel_format().
We do not expect normal CreateWindow() and GetDC() calls to ever fail.
2023-02-14 20:57:09 +01:00
Paul Gofman be57ebe015 ddraw: Do not report D3DDEVCAPS_HWRASTERIZATION for RGB emulation device. 2023-01-24 20:42:10 +01:00
Zhiyi Zhang 36afabb9c1 ddraw/tests: Do not create a fullscreen test window in test_window_position_cb().
Some window managers have trouble moving fullscreen windows to another monitor. For example, KWin
doesn't allow moving windows with _NET_WM_STATE_FULLSCREEN set. FVWM used by TestBots keeps
the size for fullscreen windows after they are moved to another monitor and when the window is also
fullscreen on the new monitor, which could be a bug in FVWM. But let's work around this in the tests
as well. The changed tests don't need created windows being fullscreen at the start.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54172
2023-01-11 20:32:07 +01:00
Paul Gofman 1a9c1d593b ddraw/tests: Release ddraw after device in test_texture_wrong_caps().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54049
2022-12-21 18:24:39 +01:00
Paul Gofman fffde3ca52 ddraw: Sync draw textures even for hardware device.
Fixes a regression introduced by commit
d2d9f713df.
2022-12-06 17:04:50 +01:00
Anton Baskanov 42503f4ea3 ddraw: Use the wined3d_streaming_buffer helpers to manage the streaming index buffer. 2022-11-24 09:19:55 +01:00
Anton Baskanov e359c1466a ddraw: Use the wined3d_streaming_buffer helpers to manage the streaming vertex buffer. 2022-11-24 09:19:55 +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
Francois Gouget c2adce37f4 ddraw/tests: Mark tests failing randomly on Windows 8 as flaky.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53134
2022-10-20 20:58:33 +02:00
Zebediah Figura 1316383268 ddraw: Add FPS tracing in ddraw_surface_update_frontbuffer().
This usually doesn't go through the normal presentation paths.
2022-09-27 18:14:34 +02:00
Stefan Dösinger 1c5bfc120d ddraw/tests: Avoid picking a large mode on Win10 in find_different_mode_callback. 2022-09-07 20:07:18 +02:00
Stefan Dösinger fc9f3bbfa5 ddraw/tests: Avoid picking a large mode on Win10 in test_coop_level_mode_set_enum_cb. 2022-09-07 20:07:18 +02:00
Zhiyi Zhang 4f00a1f9e2 ddraw: Don't report unsupported device capabilities in d3d3_EnumDevices(). 2022-08-24 09:05:47 -05:00
Zhiyi Zhang 6c391ac139 ddraw: Don't report unsupported device capabilities in d3d7_EnumDevices().
Fix Battle Realms: Zen Edition failing to start. The game expects to find a device without
D3DDEVCAPS_HWTRANSFORMANDLIGHT.
2022-08-24 09:05:45 -05:00
Zhiyi Zhang 0868bed180 ddraw/tests: Add more capability tests for enumerated devices.
Add tests for D3DDEVCAPS_HWTRANSFORMANDLIGHT and D3DDEVCAPS_DRAWPRIMITIVES2EX.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
2022-08-24 09:05:42 -05:00
Zhiyi Zhang 3c899df3b5 ddraw/tests: Move the capability tests for enumerated devices.
Move the capability tests for enumerated devices from d3d.c to ddraw{1,2,4}.c.
2022-08-24 09:05:38 -05:00
Zhiyi Zhang 21beb2a8c7 ddraw/tests: Add a comment to note that tests in d3d.c are deprecated.
And new tests should be added to tests/ddraw{1,2,4,7}.c.
2022-08-24 09:05:36 -05: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
Paul Gofman f48f5155ee ddraw: Restore full complex attachment chain in ddraw_surface7_Restore(). 2022-08-16 22:27:53 +02:00
Paul Gofman 4c0efe444d ddraw/tests: Add more tests for restoring complex surfaces. 2022-08-16 22:27:53 +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
Stefan Dösinger 7fa1259823 ddraw/tests: Add some video memory accounting tests. 2022-08-02 11:59:03 +02:00
Stefan Dösinger 8bddb9808e ddraw: Don't account video memory for sysmem surfaces' draw textures.
Star Trek Starfleet Academy does not like it when available video memory
goes down after creating a system memory resource. It destroys all its
textures and recreates them, and in some sitations forgets to recreate
one or another texture, resulting in rendering bugs.

I suspect the game is trying to detect focus loss by monitoring for
unexpected video memory changes.
2022-08-02 11:58:59 +02:00
Zebediah Figura 7375e8a9fc ddraw/tests: Build ddraw7.c without -DWINE_NO_LONG_TYPES. 2022-07-13 12:50:07 +02:00
Zebediah Figura b176b9dab1 ddraw/tests: Build ddraw4.c without -DWINE_NO_LONG_TYPES. 2022-07-13 12:50:07 +02:00
Zebediah Figura 0af510467b ddraw/tests: Build ddraw2.c without -DWINE_NO_LONG_TYPES. 2022-07-12 22:51:29 +02:00
Zebediah Figura 92793a6e73 ddraw/tests: Build ddraw1.c without -DWINE_NO_LONG_TYPES. 2022-07-12 22:51:29 +02:00
Zebediah Figura fcaa16ae40 ddraw/tests: Build visual.c without -DWINE_NO_LONG_TYPES. 2022-07-11 10:33:29 +02:00
Zebediah Figura a4bf81081d ddraw/tests: Build refcount.c without -DWINE_NO_LONG_TYPES. 2022-07-11 10:33:29 +02:00
Zebediah Figura cc7eae0c8f ddraw/tests: Build dsurface.c without -DWINE_NO_LONG_TYPES. 2022-07-11 10:33:27 +02:00
Zebediah Figura 8a56c4dbba ddraw/tests: Build ddrawmodes.c without -DWINE_NO_LONG_TYPES. 2022-07-08 10:48:28 +02:00
Zebediah Figura 0f45657137 ddraw/tests: Build d3d.c without -DWINE_NO_LONG_TYPES. 2022-07-08 10:48:28 +02:00
Zebediah Figura 27e84c2897 wined3d: Consider WINED3D_LOCATION_CLEARED to be a GPU location for GPU-accessible textures.
When blitting from a staging texture in SYSMEM to an as-yet uninitialized GPU
texture, we want to avoid ever loading the source texture into TEXTURE_RGB, or
loading the destination texture into SYSMEM.

This isn't really a proper fix for the relevant tests; it just manages to avoid
the problematic code path.

This manages to fix test_yv12_overlay because it causes those blits to use the
upload path (whereas currently they go through the raw blitter, and before
1632b8e7a4 they would go through the CPU blitter), and
wined3d_texture_gl_upload_data() is one of the only functions to correctly
handle planar YUV formats.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52684
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-27 11:53:11 +02:00