Paul Gofman : ddraw: Allow setting system memory surfaces as render targets for software device.

Alexandre Julliard julliard at winehq.org
Fri Mar 12 14:36:16 CST 2021


Module: wine
Branch: master
Commit: ff6bf06ce3663c4f2a8b14f4a5f3d5ca0443ce4d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ff6bf06ce3663c4f2a8b14f4a5f3d5ca0443ce4d

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Thu Mar 11 16:33:57 2021 +0300

ddraw: Allow setting system memory surfaces as render targets for software device.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ddraw/device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 1ea28709e9d..005de0805e1 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -1898,7 +1898,7 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface,
         return DDERR_INVALIDCAPS;
     }
 
-    if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
+    if (device->hardware_device && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
     {
         WARN("Surface %p is not in video memory.\n", target_impl);
         wined3d_mutex_unlock();
@@ -1974,7 +1974,7 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface,
         return DDERR_INVALIDPIXELFORMAT;
     }
 
-    if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
+    if (device->hardware_device && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
     {
         WARN("Surface %p is not in video memory.\n", target_impl);
         IDirectDrawSurface4_AddRef(target);
@@ -2023,7 +2023,7 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface,
         return DDERR_INVALIDPIXELFORMAT;
     }
 
-    if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
+    if (device->hardware_device && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
     {
         WARN("Surface %p is not in video memory.\n", target_impl);
         IDirectDrawSurface_AddRef(target);




More information about the wine-cvs mailing list