Commit Graph

2749 Commits

Author SHA1 Message Date
Zhiyi Zhang b911e56045 wined3d: Restore display modes for all outputs when doing mode restoration.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-03 21:47:27 +01:00
Zhiyi Zhang 1a4f2e23c0 ddraw/tests: Test display mode restoration.
Mostly to test that when doing mode restoration, all display outputs get restored to their display
settings in the registry, not just one output gets restored.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 22:14:11 +01:00
Zhiyi Zhang 8915500868 ddraw/tests: Fix possible memory leaks.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-21 20:30:38 +02:00
Zhiyi Zhang e89c85118b ddraw/tests: Use the correct version of DirectDraw calls.
These are typos cumulated over the years.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-21 20:30:35 +02:00
Zhiyi Zhang 9288f31015 dxgi: Update swapchain containing output after Alt+Enter was used to exit fullscreen.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-09 16:21:33 +02:00
Zhiyi Zhang 5ec9505a5c ddraw: Report correct frequency in GetDisplayMode().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 21:16:49 +02:00
Zhiyi Zhang d4fdb1f62c ddraw/tests: Add display mode frequency tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 21:16:49 +02:00
Stefan Dösinger 6a276eba16 ddraw: Thunk to surface1, not surface7 in flip.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 18:07:58 +02:00
Stefan Dösinger 6b5ea56905 ddraw: Thunk to surface1, not surface7 in surface_unlock.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 18:07:56 +02:00
Stefan Dösinger 3b2aab9a8c ddraw: Thunk to surface1, not surface7 in blt.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 18:07:47 +02:00
Gabriel Ivăncescu 992e3055b5 ddraw: Check the foreground window in addition to the device state in ddraw_update_lost_surfaces().
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:33:11 +02:00
Gabriel Ivăncescu 6179ac14cb ddraw: Return DDERR_WRONGMODE when attempting to restore surfaces of a lost device.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:33:10 +02:00
Gabriel Ivăncescu 7e56c12c0f ddraw/tests: Test non-primary video memory surface in test_lost_device().
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:33:07 +02:00
Rémi Bernon f90d607c67 ddraw: Use the WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES flag.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-07 21:18:11 +02:00
Paul Gofman 2cbab8a0a2 ddraw/tests: Port _SetSurfaceDesc() tests for mipmaps and DDSD_LPSURFACE for ddraw2.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 18:35:15 +02:00
Paul Gofman ca374dd67e ddraw/tests: Port _SetSurfaceDesc() tests for mipmaps and DDSD_LPSURFACE for ddraw4.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 18:35:13 +02:00
Paul Gofman fde4cca30b ddraw/tests: Add more tests for _SetSurfaceDesc with mipmaps.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 18:35:10 +02:00
Paul Gofman cfeefc6b94 wined3d: Set user memory separately for texture sub resources.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43232
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 18:35:07 +02:00
Paul Gofman 422e05d844 ddraw: Update texture_memory when setting new texture parent in ddraw_surface7_Flip().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49391
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 00:05:44 +02:00
Zhiyi Zhang 079caeaa8d ddraw: Get new window size from the primary output after display mode changes.
MonitorFromWindow() may return a different monitor if switching to a
smaller display mode.

Fix Railroad Tycoon II crashes.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-28 20:18:32 +02:00
Paul Gofman f02b0226ca wined3d: Allow setting user memory for mipmapped textures in wined3d_texture_update_desc().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49105
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 23:12:31 +02:00
Zhiyi Zhang d3e088cc00 wined3d: Specify a wined3d output for swapchain creation.
As tests showed, DirectDraw, Direct3D 8 and 9 always use the adapter
specified in the device creation parameters regardless of the device
window position when creating a swapchain. Whereas DXGI uses the device
window position to determine which DXGI output to use.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-13 22:07:32 +02:00
Zhiyi Zhang 248b5d7427 ddraw/tests: Add get display mode tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-11 21:24:58 +02:00
Zhiyi Zhang 5f0608396c ddraw/tests: Test window position.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-11 21:24:58 +02:00
Zebediah Figura 616585d7fb ddraw: Implement DDENUMSURFACES_CANBECREATED.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=17233
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:53:02 +02:00
Zebediah Figura 8e8e0f48c4 ddraw: Properly compare DDENUMSURFACES_NOMATCH to TRUE.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:53:02 +02:00
Zebediah Figura 2389fae064 ddraw/tests: Add more tests for EnumSurfaces().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-05 20:53:02 +02:00
Zebediah Figura b95fe88ff5 ddraw/tests: Test vtbl protection.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 19:41:31 +02:00
Alistair Leslie-Hughes 0b55384f0d ddraw: Make palette and remaining surface vtbls writable.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46949
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 19:41:27 +02:00
Michael Müller 100ca51805 ddraw: Make ddraw1_vtbl and ddraw_surface1_vtbl writable.
Wine-Bug: <https://bugs.winehq.org/show_bug.cgi?id=39534>
Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 19:41:24 +02:00
Zhiyi Zhang dc6af98c11 ddraw: Handle more cases in hr_ddraw_from_wined3d().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-21 21:51:07 +02:00
Chip Davis 42e932e63f wined3d: Remove WINED3D_RS_EDGEANTIALIAS.
Handle this render state similarly to D3DRS_ZFUNC, by mapping it in the
client DLLs.

As far as I can tell, save for the fact that it's only supposed to apply
to lines forming a convex outline, it's roughly equivalent to
D3DRS_ANTIALIASEDLINEENABLE. We definitely handled it the same way.

Curiously, even though we supported the render state, we didn't set the
corresponding capability bit. Do that now.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 19:40:26 +02:00
Paul Gofman c24551cae8 ddraw/tests: Test system memory surface with lost device for ddraw1.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 19:40:21 +02:00
Paul Gofman 47e777d6ea ddraw/tests: Test system memory surface with lost device for ddraw2.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 19:40:19 +02:00
Paul Gofman f2ba4d78d3 ddraw/tests: Test system memory surface with lost device for ddraw4.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 19:40:14 +02:00
Paul Gofman 3acc26dc22 ddraw: Check surface flags when marking surface as lost.
Fixes a regression triggered by 530a3d94de.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48923
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 19:40:04 +02:00
Paul Gofman e1a79d4d7c ddraw: Convert BOOL flags to bitfields in ddraw_surface.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 19:40:01 +02:00
Zhiyi Zhang f91dd56ccd wined3d: Do not clip the cursor after changing display modes.
DirectDraw should clip the cursor to the primary monitor only when the
cooperative level is DDSCL_EXCLUSIVE. For Direct3D 8, 9 and DXGI,
changing display modes shouldn't clip the cursor as tests showed.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-09 21:04:04 +02:00
Zhiyi Zhang 5a2e6f5e58 ddraw/tests: Test cursor clipping.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-09 21:04:04 +02:00
Akihiro Sagawa 62e13708d0 ddraw: Allow to create managed textures with DDSCAPS_TEXTURE|DDSCAPS_3DDEVICE caps.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48844
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-02 12:56:37 +02:00
Akihiro Sagawa 8bb3ebced4 ddraw/tests: Add more managed texture tests.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-02 12:56:32 +02:00
Chip Davis 7dce36c8f5 ddraw: Introduce a helper to convert ddraw stateblock types to wined3d types.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 17:25:05 +02:00
Chip Davis 02d03a66a5 ddraw: Introduce a helper to convert ddraw primitive types to wined3d types.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 17:25:02 +02:00
Chip Davis 67d71cb2d0 ddraw: Introduce a helper to convert ddraw transform states to wined3d states.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 17:24:56 +02:00
Chip Davis c07fdf8a90 ddraw: Introduce a helper to convert ddraw render states to wined3d states.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 17:24:53 +02:00
Paul Gofman d0ff5e66a7 ddraw: Reserve extra space for video memory surfaces in compatibility mode.
Some old apps write surface data past the end of locked space. That
used to work on early ddraw hardware as locked surface provided
direct access to video memory mapped to CPU address space and such
access could often go without issues. Currently ddraw on Windows
allocates bigger buffers for video memory surfaces when 8 or 16 bit
display mode is requested.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48788
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 15:53:54 +02:00
Chip Davis d5f25c2cd7 ddraw/tests: Introduce compare_uint().
Analogous to compare_float().

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 23:10:07 +02:00
Paul Gofman 792dc34978 ddraw/tests: Test locking lost surface for ddraw1.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 18:34:50 +01:00
Paul Gofman 98b8f680b1 ddraw/tests: Test locking lost surface for ddraw2.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 18:34:50 +01:00
Paul Gofman d79f5a2a9f ddraw/tests: Test locking lost surface for ddraw4.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 18:34:50 +01:00