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.
This commit is contained in:
Henri Verbeet 2013-09-17 09:22:37 +02:00 committed by Alexandre Julliard
parent df01e8d6cc
commit 3fb53e21fb
1 changed files with 5 additions and 5 deletions

View File

@ -5740,8 +5740,11 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
desc->ddsCaps.dwCaps |= DDSCAPS_VISIBLE; desc->ddsCaps.dwCaps |= DDSCAPS_VISIBLE;
if ((desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) && !(desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)) if (!(desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY))
{ {
if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
usage |= WINED3DUSAGE_DEPTHSTENCIL;
else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
usage |= WINED3DUSAGE_RENDERTARGET; usage |= WINED3DUSAGE_RENDERTARGET;
} }
@ -5750,9 +5753,6 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
usage |= WINED3DUSAGE_OVERLAY; usage |= WINED3DUSAGE_OVERLAY;
} }
if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
usage |= WINED3DUSAGE_DEPTHSTENCIL;
if (desc->ddsCaps.dwCaps & DDSCAPS_OWNDC) if (desc->ddsCaps.dwCaps & DDSCAPS_OWNDC)
usage |= WINED3DUSAGE_OWNDC; usage |= WINED3DUSAGE_OWNDC;