ddraw: Force surfaces without memory flags to video memory on creation.

Also removes now redundant setting of vidmem flag on rendertargets, prevents 
adding vidmem flag when sysmem flag is present. Fixes missing textures in Forsaken.
oldstable
Alexander Dorofeyev 2008-07-15 00:58:08 +03:00 committed by Alexandre Julliard
parent 3a1e2a304e
commit 59fc5a75e0
2 changed files with 7 additions and 13 deletions

View File

@ -1917,6 +1917,12 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
}
}
if (!(pDDSD->ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY)) &&
!((pDDSD->ddsCaps.dwCaps & DDSCAPS_TEXTURE) && (pDDSD->ddsCaps.dwCaps2 & DDSCAPS2_TEXTUREMANAGE)) )
{
/* Tests show surfaces without memory flags get these flags added right after creation. */
pDDSD->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY;
}
/* Get the correct wined3d usage */
if (pDDSD->ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE |
DDSCAPS_BACKBUFFER |
@ -1924,8 +1930,7 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
{
Usage |= WINED3DUSAGE_RENDERTARGET;
pDDSD->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY |
DDSCAPS_VISIBLE;
pDDSD->ddsCaps.dwCaps |= DDSCAPS_VISIBLE;
}
if (pDDSD->ddsCaps.dwCaps & (DDSCAPS_OVERLAY))
{
@ -2345,11 +2350,6 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
/* DVIDEO.DLL does forget the DDSD_CAPS flag ... *sigh* */
DDSD->dwFlags |= DDSD_CAPS;
}
if (DDSD->ddsCaps.dwCaps == 0)
{
/* This has been checked on real Windows */
DDSD->ddsCaps.dwCaps = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY;
}
if (DDSD->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD)
{

View File

@ -324,12 +324,6 @@ IDirect3DTextureImpl_Load(IDirect3DTexture2 *iface,
TRACE(" copying surface %p to surface %p (mipmap level %d)\n", src_ptr, This, src_ptr->mipmap_level);
if ( This->surface_desc.ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD )
/* If the surface is not allocated and its location is not yet specified,
force it to video memory */
if ( !(This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY)) )
This->surface_desc.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
/* Suppress the ALLOCONLOAD flag */
This->surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;