Commit Graph

495 Commits

Author SHA1 Message Date
Henri Verbeet 23713ee2a8 ddraw: Create swapchains with back-buffers.
As preparation for the next patch. Note that we drop WINED3DUSAGE_RENDERTARGET
here. We never render directly to the back-buffer in ddraw, since ddraw
back-buffers don't directly correspond to wined3d back-buffers. Moreover,
ddraw may create WINED3DFMT_P8_UINT swapchains, for which
WINED3DUSAGE_RENDERTARGET wouldn't be valid.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-27 16:13:16 +02:00
Henri Verbeet 0a354365bd wined3d: Merge the surface_created() and volume_created() wined3d_device_parent_ops callbacks.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-16 16:40:31 +01:00
Michael Stefaniuc 27ef844bd1 ddraw: Use the available ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 12:40:54 +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
Józef Kucia 4701425f3c wined3d: Add buffer usage to wined3d_swapchain_desc.
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>
2018-01-25 16:27:10 +01:00
Alexandre Julliard 749e280df7 ddraw: Validate the surface descriptor size in GetDisplayMode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-21 16:06:02 +01:00
Józef Kucia d1f5189759 ddraw: Cleanup ddraw_get_d3dcaps().
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-04 11:51:51 +01:00
Francois Gouget d2aa533b9c ddraw: Make ddraw_destroy_swapchain() 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-17 15:54:08 +01:00
Nikolay Sivov f55a10a07d ddraw: Remove references to IWineD3DDevice that doesn't exist anymore.
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-02-27 09:56:31 +01:00
Matteo Bruni 68709850f1 ddraw: Get rid of multiple interfaces from vertex buffer objects.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-27 09:56:25 +01:00
Alex Henrie 062f1ae752 ddraw: Validate the "surface" pointer before creating the surface in CreateSurface().
And thereby avoid leaking the surface on the error path.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-16 19:08:36 +01:00
Nikolay Sivov 1a7ddf8dd9 dxgi: Added support for DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE.
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-02-09 13:16:57 +01:00
Henri Verbeet aa8cedb033 ddraw: Update the primary surface format when changing the display mode.
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 0885e3f5ae ddraw: Mark surfaces as lost when changing the display mode.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-01 16:26:51 +01:00
Alex Henrie c9e29bff7b ddraw: Don't crash if writing out a new ddraw7 surface segfaults.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:48 +01:00
Alex Henrie 1850ac5770 ddraw: Don't crash if writing out a new ddraw4 surface segfaults.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:48 +01:00
Alex Henrie f6997e8fe0 ddraw: Don't crash if writing out a new ddraw2 surface segfaults.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:48 +01:00
Alex Henrie d9f2b4627a ddraw: Don't crash if writing out a new ddraw1 surface segfaults.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:48 +01:00
Józef Kucia d7b3ef0783 ddraw: Cleanup ddraw7_GetAvailableVidMem().
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:20 +01:00
Henri Verbeet e48d75862f ddraw: Set the swapchain palette in ddraw_create_swapchain().
This fixes a regression introduced by commit
9d49b7a9be.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-13 14:51:13 +01:00
Józef Kucia 9090995115 ddraw: Subtract framebuffer size from reported available video memory.
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-02 20:27:10 +01:00
Józef Kucia 2f5850c56a wined3d: Add WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT flag.
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>
2016-08-03 09:56:17 -05:00
Józef Kucia 8d032351f2 wined3d: Add WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH flag.
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>
2016-08-03 09:56:17 -05:00
Józef Kucia 64014ae3ed wined3d: Add "layer_count" parameter to wined3d_texture_create().
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>
2016-04-26 21:35:31 +09:00
Francois Gouget 2738f7690d ddraw: Remove DDENUMSURFACES_{MATCH,SEARCH}TYPE as they are unused.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-25 18:48:19 +09:00
Francois Gouget 8f42343c02 ddraw: Spelling and plural fixes in comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-20 21:50:35 +09:00
Henri Verbeet f519aca8b3 wined3d: Reject sub-resource types in wined3d_check_device_format().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-19 14:56:14 +09:00
Henri Verbeet 3b5eca269d wined3d: Get rid of the surface parameter to wined3d_device_parent_ops.surface_created().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-12 23:07:28 +09:00
Henri Verbeet 6e5fa92299 ddraw: Use wined3d_texture_get_pitch() in ddraw_surface_init().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-12 23:07:28 +09:00
Riccardo Bortolato b278bb8f56 wined3d: Get rid of wined3d_device_get_surface_from_dc().
Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-09 12:19:39 +09:00
Henri Verbeet 257ee8cc6e ddraw: Use wined3d_texture_blt() in ddraw_surface_update_frontbuffer().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-01 17:53:36 +09:00
Henri Verbeet d6e7f18c84 ddraw: Use wined3d_texture_blt() in ddraw_surface7_BltFast().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:15 +09:00
Henri Verbeet ce882bd6b4 ddraw: Always store a pointer to the wined3d texture in the surface.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:15 +09:00
Henri Verbeet ad11f38db9 wined3d: Rename the texture creation flags to WINED3D_TEXTURE_CREATE_*.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-27 12:38:54 +09:00
Henri Verbeet 571dc0faa5 ddraw: Mark surfaces as lost on mode changes.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-09 01:01:56 +09:00
Henri Verbeet 821c2ed6a3 ddraw: Do not mark surfaces as lost unconditionally when setting the cooperative level.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-04 21:56:19 +09:00
Henri Verbeet 1ebb42ca53 ddraw: Mark surfaces as lost when the device window is deactivated.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-04 21:56:19 +09:00
Andrey Gusev 8bfc9bd2ee Assorted typos fixes.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-27 15:38:30 +09:00
Riccardo Bortolato 9c00f968d6 d3d8: Make use of wined3d_texture_map in d3d8_surface_LockRect.
Pass wined3d_texture and sub_resource idx to device_parent_surface_created callback.
Store wined3d_texture and sub_resource in d3d8_surface.
Also updated d3d9, d3d11, ddraw callbacks accordingly.

Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-12 23:34:56 +09:00
Riccardo Bortolato 33bb9e9610 wined3d: Don't pass a wined3d_volume to device_volume_created callback anymore.
Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-08 21:00:07 +09:00
Riccardo Bortolato 9621737c8e wined3d: Pass wined3d_texture and sub_resource idx to device_volume_created callback.
Store wined3d_texture and sub_resource in d3d8_volume.
Updated the d3d8_volume_LockBox to make use of wined3d_texture_map.
Also updated d3d9, d3d11, ddraw callbacks accordingly.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2015-10-07 21:28:52 +09:00
Stefan Dösinger fa0041954f wined3d: Return a texture from the swapchain resource creation callback. 2015-09-04 20:01:05 +09:00
Henri Verbeet 4c5276042d ddraw: Check if the ddraw object still exists in d3d_device_inner_Release() (Valgrind). 2015-04-30 16:17:51 +09:00
Matteo Bruni b963c73abb wined3d: Introduce D3D7+ normal matrix computation. 2015-04-24 19:07:52 +09:00
Henri Verbeet 94967c28b9 wined3d: Add support for half-integer pixel centers.
Like in OpenGL and Direct3D 10+.
2015-03-30 19:10:29 +09:00
Amine Khaldi 21bfc8c440 include: Correct DDSCAPS2 and DDSURFACEDESC2 structures and their uses. 2015-03-02 23:00:32 +09:00
Henri Verbeet ea534c9ab4 wined3d: Allow initial texture contents to be specified with wined3d_texture_create(). 2015-01-05 20:15:35 +01:00
Stefan Dösinger 19c860499a wined3d: Filter messages generated by focus handling. 2014-12-08 14:18:43 +01:00
Stefan Dösinger f905c7c07a ddraw: Restore the registry display mode. 2014-11-20 22:31:39 +09:00
Stefan Dösinger f6dde70624 wined3d: Restore the display mode on focus change. 2014-11-19 17:56:44 +09:00