Module: wine Branch: master Commit: 3fb53e21fb2cccf249ed65a4641eac21422f6609 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3fb53e21fb2cccf249ed65a464...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Sep 17 09:22:37 2013 +0200
ddraw: Don't set render target / depth stencil usage on sysmem surfaces.
Setting render target usage on a P8 surface for example would fail surface creation, while such surfaces can't be used for actual rendering anyway. Tests confirm that surface creation is supposed to succeed for P8 surfaces with both DDSCAPS_SYSTEMMEMORY and DDSCAPS_3DDEVICE set.
---
dlls/ddraw/surface.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index d23fc9c..416c13f 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5740,9 +5740,12 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) desc->ddsCaps.dwCaps |= DDSCAPS_VISIBLE;
- if ((desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) && !(desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)) + if (!(desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY)) { - usage |= WINED3DUSAGE_RENDERTARGET; + if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) + usage |= WINED3DUSAGE_DEPTHSTENCIL; + else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) + usage |= WINED3DUSAGE_RENDERTARGET; }
if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY)) @@ -5750,9 +5753,6 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, usage |= WINED3DUSAGE_OVERLAY; }
- if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) - usage |= WINED3DUSAGE_DEPTHSTENCIL; - if (desc->ddsCaps.dwCaps & DDSCAPS_OWNDC) usage |= WINED3DUSAGE_OWNDC;