Commit 3fb53e21 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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.
parent df01e8d6
...@@ -5740,9 +5740,12 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, ...@@ -5740,9 +5740,12 @@ 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))
{ {
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)) if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY))
...@@ -5750,9 +5753,6 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment