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:
parent
df01e8d6cc
commit
3fb53e21fb
|
@ -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,
|
||||||
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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue