diff --git a/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch b/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch index 50fcc507..2c406eb1 100644 --- a/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch +++ b/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch @@ -1,4 +1,4 @@ -From cf433894ff56fda93491753843e0f4f658f67c8c Mon Sep 17 00:00:00 2001 +From 599d50340aaf37f2eb39a789a4034e677d52e92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 29 Jul 2015 17:09:50 +0200 Subject: [PATCH] ddraw: Create rendering targets in video memory if possible. @@ -12,10 +12,10 @@ Based on a patch by Henri Verbeet. 4 files changed, 53 insertions(+), 15 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c -index 9a40bc9..6f3d058 100644 +index 6b2abe3..dfd52a0 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c -@@ -4210,7 +4210,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid, +@@ -4209,7 +4209,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid, TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device); wined3d_mutex_lock(); @@ -24,7 +24,7 @@ index 9a40bc9..6f3d058 100644 { *device = &object->IDirect3DDevice7_iface; } -@@ -4239,7 +4239,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid, +@@ -4238,7 +4238,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid, return CLASS_E_NOAGGREGATION; wined3d_mutex_lock(); @@ -33,7 +33,7 @@ index 9a40bc9..6f3d058 100644 { *device = &device_impl->IDirect3DDevice3_iface; } -@@ -4265,7 +4265,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid, +@@ -4264,7 +4264,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid, iface, debugstr_guid(riid), surface, device); wined3d_mutex_lock(); @@ -43,7 +43,7 @@ index 9a40bc9..6f3d058 100644 *device = &device_impl->IDirect3DDevice2_iface; } diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h -index 495cb8b..4af638b 100644 +index b035a7e..699f719 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -303,6 +303,7 @@ struct d3d_device @@ -152,7 +152,7 @@ index 0d48c7d..2bef17d 100644 WARN("Failed to initialize device, hr %#x.\n", hr); heap_free(object); diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index 5ce1d85..e729348 100644 +index 8190442..c73981b 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -226,7 +226,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface, @@ -194,11 +194,11 @@ index 5ce1d85..e729348 100644 + */ + if ((desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) && + SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT, -+ WINED3D_DEVICE_TYPE_HAL, mode.format_id, WINED3DUSAGE_RENDERTARGET, ++ WINED3D_DEVICE_TYPE_HAL, mode.format_id, 0, + bind_flags, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format))) + { + FIXME("Application wants to create rendering target in system memory, using video memory instead\n"); -+ wined3d_desc.usage |= WINED3DUSAGE_RENDERTARGET; ++ wined3d_desc.usage = wined3d_desc.bind_flags; + } + else + wined3d_desc.access = WINED3D_RESOURCE_ACCESS_CPU diff --git a/patches/ddraw-Rendering_Targets/definition b/patches/ddraw-Rendering_Targets/definition index eeaa0e28..b51d8e4c 100644 --- a/patches/ddraw-Rendering_Targets/definition +++ b/patches/ddraw-Rendering_Targets/definition @@ -1,2 +1 @@ Fixes: [34906] Use video memory for rendering targets if possible -Disabled: True diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e86834be..42582157 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -129,6 +129,7 @@ patch_enable_all () enable_ddraw_Fix_Typos="$1" enable_ddraw_FlipToGDISurface="$1" enable_ddraw_IDirect3DTexture2_Load="$1" + enable_ddraw_Rendering_Targets="$1" enable_ddraw_Silence_FIXMEs="$1" enable_ddraw_Write_Vtable="$1" enable_dinput_Deadlock="$1" @@ -543,6 +544,9 @@ patch_enable () ddraw-IDirect3DTexture2_Load) enable_ddraw_IDirect3DTexture2_Load="$2" ;; + ddraw-Rendering_Targets) + enable_ddraw_Rendering_Targets="$2" + ;; ddraw-Silence_FIXMEs) enable_ddraw_Silence_FIXMEs="$2" ;; @@ -3268,6 +3272,21 @@ if test "$enable_ddraw_IDirect3DTexture2_Load" -eq 1; then ) >> "$patchlist" fi +# Patchset ddraw-Rendering_Targets +# | +# | This patchset fixes the following Wine bugs: +# | * [#34906] Use video memory for rendering targets if possible +# | +# | Modified files: +# | * dlls/ddraw/ddraw.c, dlls/ddraw/ddraw_private.h, dlls/ddraw/device.c, dlls/ddraw/surface.c +# | +if test "$enable_ddraw_Rendering_Targets" -eq 1; then + patch_apply ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch + ( + printf '%s\n' '+ { "Michael Müller", "ddraw: Create rendering targets in video memory if possible.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ddraw-Silence_FIXMEs # | # | Modified files: