Commit Graph

477 Commits

Author SHA1 Message Date
Zhiyi Zhang c9f0d862b5 wined3d: Pass a struct wined3d_adapter pointer to wined3d_calculate_format_pitch().
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-03-11 15:55:16 +01:00
Zhiyi Zhang f2a850c844 wined3d: Pass a struct wined3d_adapter pointer to wined3d_check_device_format().
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-03-11 15:55:13 +01:00
Zhiyi Zhang aa177f6afc wined3d: Refactor wined3d_get_adapter_display_mode() to wined3d_output_get_display_mode().
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-03-06 17:54:06 +01:00
Zebediah Figura dd561ba229 ddraw: Stop setting the device state when setting some default render states.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-06 21:40:22 +01:00
Zebediah Figura 92dd6dd150 ddraw: Apply the device state before executing a draw call.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-06 21:40:22 +01:00
Zebediah Figura 769ba7d1e9 ddraw: Track WINED3D_RS_ZENABLE in the primary stateblock.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-18 19:12:14 +01:00
Zebediah Figura 6c51a93b63 ddraw: Reset the stateblock state before calling wined3d_device_reset().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-28 18:33:12 +01:00
Zebediah Figura db9db753c3 ddraw: Track the primary stateblock state locally.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-23 21:03:49 +02:00
Zebediah Figura 7360e7d488 wined3d: Return a wined3d_stateblock from wined3d_device_begin_stateblock().
And hold it locally in d3d[789].

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-26 21:00:13 +02:00
Henri Verbeet 669e3ac3de ddraw: Release the wined3d mutex on error paths in ddraw_surface7_Blt().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-14 14:31:02 +02:00
Paul Gofman 5c9a7b0986 ddraw: Restore complex attached surfaces when restoring surface.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47586
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-07 00:38:49 +02:00
Paul Gofman 7361c7f2cd ddraw: Return DDERR_SURFACELOST from _GetAttachedSurface() if surface is lost.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-07 00:38:41 +02:00
Alexandre Julliard 0d48c2e796 ddraw: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-02 10:00:29 +02:00
Stefan Dösinger 347efb985c ddraw: Don't operate on stored invalid clippers.
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>
2019-03-22 20:31:54 +01:00
Stefan Dösinger e809a500d7 ddraw: Clear *clipper on failure in ddraw_surface7_GetClipper().
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>
2019-03-13 23:40:39 +01:00
Matteo Bruni 019ec46602 ddraw: Refuse to create non-managed DDSCAPS_WRITEONLY surfaces.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-05 19:27:08 +01:00
David Adam f5d7d9cccc ddraw: Fix the "dwMipMapCount" field of texture sub-levels.
Instead of the total count, it indicates the count starting from the current
level.

Signed-off-by: David Adam <david.adam.cnrs@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-23 23:52:22 +01:00
Henri Verbeet 0a2b0d4a95 ddraw: Return the correct swapchain surface in ddraw7_GetGDISurface().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-23 16:35:38 +01:00
Henri Verbeet 9bac6f159c wined3d: Disallow dynamic rendertarget and depth/stencil resources.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-19 22:42:41 +01:00
Henri Verbeet 03c1422a71 wined3d: Get rid of WINED3DUSAGE_TEXTURE.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-06 11:14:36 +01:00
Henri Verbeet a0d6ef5bb4 wined3d: Get rid of WINED3DUSAGE_DEPTHSTENCIL.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-06 11:14:34 +01:00
Henri Verbeet 3adf4b8415 wined3d: Get rid of WINED3DUSAGE_RENDERTARGET.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-05 19:12:12 +01:00
Henri Verbeet ae6553bd0b wined3d: Pass bind flags to wined3d_check_device_format().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-31 16:17:36 +01:00
Henri Verbeet 7cba915710 wined3d: Pass correct bind flags to texture creation functions.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-31 16:17:36 +01:00
Henri Verbeet fbcdf8c698 ddraw: Only do asynchronous clears when the application asked for them.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-28 01:12:04 +02:00
Henri Verbeet 8ac639d25c ddraw: Do not request 3D-usages for DDRAW_NO3D surfaces.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-26 16:50:46 +02:00
Henri Verbeet 33d182dd54 ddraw: Reject creating DDSCAPS_VIDEOMEMORY surfaces with DDRAW_NO3D.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-25 12:29:06 +02:00
Zebediah Figura 2689f3e68b ddraw: Avoid leaking references to the wined3d device.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-22 17:02:23 +02:00
Henri Verbeet a362daeaf5 ddraw: Copy the entire front-buffer surface after a buffer swap.
wined3d_swapchain_present() will invalidate everything except
WINED3D_LOCATION_DRAWABLE, which means a partial blit to the front-buffer
afterwards might need to read the drawable contents back to the texture. For
P8 front-buffers that's problematic, because the original palette indices are
lost. We may want to improve the wined3d side of this to avoid reading back
the drawable, but copying the entire surface in ddraw in this situation seems
like a good idea regardless.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-30 16:52:05 +02:00
Henri Verbeet 034e88e038 ddraw: Take the flip interval into account in ddraw_surface7_Flip().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-27 16:13:18 +02:00
Henri Verbeet 1bd9cb3471 ddraw: Compare with the correct view in ddraw_surface_delete_attached_surface().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-19 16:55:08 +01:00
Henri Verbeet 6ca15e9c13 wined3d: Split WINED3D_RESOURCE_ACCESS_MAP into WINED3D_RESOURCE_ACCESS_MAP_R and WINED3D_RESOURCE_ACCESS_MAP_W.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-19 13:43:52 +01:00
Henri Verbeet acc0f49aae wined3d: Introduce separate read and write resource map flags.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-19 13:43:52 +01:00
Henri Verbeet 72c31c146b ddraw: Explicitly translate resource map flags.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-16 14:24:58 +01:00
Henri Verbeet 9cc7c6e99f ddraw: Use the global memory allocation helpers.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-13 20:23:26 +01:00
Henri Verbeet 46f20e4198 ddraw: Set WINED3D_RESOURCE_ACCESS_MAP on textures.
Like buffers, WINED3D_RESOURCE_ACCESS_MAP is not currently enforced on 2D
textures in wined3d.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-12 15:33:09 +01:00
Henri Verbeet 9275b06cc0 wined3d: Replace the pool in struct wined3d_resource_desc with resource access flags.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-02 18:36:45 +01:00
Józef Kucia 46fa862dc4 ddraw: Set depth test state while resetting device.
wined3d will not do this anymore.

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>
2017-12-07 19:14:31 +01:00
Henri Verbeet fb4740bbb3 ddraw: Validate that non-fill blits have a source surface in ddraw_surface7_Blt().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-02 15:38:47 +02:00
Henri Verbeet 5ff2fdc452 wined3d: Make blits asynchronous by default.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-25 08:44:54 +02:00
Henri Verbeet 6b41501344 ddraw: Ignore unsupported blit flags.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-25 08:44:48 +02:00
Henri Verbeet df6120274d wined3d: Introduce a helper function to assign wined3d_box values.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-07 11:37:28 +02:00
Henri Verbeet 381cd03eb3 ddraw: Implement depth/colour fills on top of wined3d_device_clear_rendertarget_view().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 09:01:57 +02:00
Francois Gouget b7d0b4d8a6 ddraw: Make ddraw_surface_release_iface() static.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-24 20:51:15 +01:00
Stefan Dösinger c3521cd673 ddraw/tests: Rewrite SrcColorKey32BlitTest.
Signed-off-by: Stefan Dösinger <stefandoesinger@gmx.at>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-09 20:13:23 +01:00
Nikolay Sivov 84a8f7f457 ddraw: Remove referenced to IWineD3D* interfaces.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-06 19:45:08 +01:00
Henri Verbeet 312cb81138 ddraw: Validate the primary surface format in ddraw_surface7_Restore().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-01 16:26:52 +01:00
Henri Verbeet ca6b29983b ddraw: Validate the primary surface dimensions in ddraw_surface7_Restore().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-01 16:26:51 +01:00
Józef Kucia 2bef0eafd0 ddraw: Relax "dwSize" validation in ddraw_surface*_Lock().
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>
2017-01-25 15:52:35 +01:00
Henri Verbeet c7c0415689 ddraw: Keep an explicit reference to the wined3d device in surfaces.
Version 1 and version 2 surfaces don't keep references to the ddraw interface
that created them, so such surfaces may get destroyed after the corresponding
ddraw object was destroyed. Wined3d requires that the device is destroyed
after all its resources are destroyed. In principle this issue always existed,
but it was probably made worse by changes in the texture cleanup code.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-04 11:11:09 +01:00