Commit db68ffcb authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw: Treat D3DTEXTUREMANAGE like TEXTUREMANAGE.

Sim City 4 uses this flag. The main problem I noticed was with WINED3D_MAP_DISCARD handling introduced for surfaces in patches that aren't yet in the tree, but the difference already matters for older cards because of video memory accounting.
parent 9c456ef8
......@@ -2962,7 +2962,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
}
}
if (DDSD->ddsCaps.dwCaps2 & DDSCAPS2_TEXTUREMANAGE)
if (DDSD->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))
{
if (!(DDSD->ddsCaps.dwCaps & DDSCAPS_TEXTURE))
{
......@@ -3001,7 +3001,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
}
if (!(desc2.ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))
&& !(desc2.ddsCaps.dwCaps2 & DDSCAPS2_TEXTUREMANAGE))
&& !(desc2.ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE)))
{
enum wined3d_format_id format = wined3dformat_from_ddrawformat(&desc2.u4.ddpfPixelFormat);
enum wined3d_resource_type rtype;
......
......@@ -5608,7 +5608,7 @@ HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface, DWORD surfac
else
layers = 1;
if (desc->ddsCaps.dwCaps2 & DDSCAPS2_TEXTUREMANAGE)
if (desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))
{
wined3d_desc.usage = WINED3DUSAGE_TEXTURE;
pool = WINED3D_POOL_MANAGED;
......@@ -5730,7 +5730,7 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
if (!(desc->ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))
&& !((desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
&& (desc->ddsCaps.dwCaps2 & DDSCAPS2_TEXTUREMANAGE)))
&& (desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))))
{
/* Tests show surfaces without memory flags get these flags added
* right after creation. */
......@@ -5760,7 +5760,7 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
{
pool = WINED3D_POOL_SYSTEM_MEM;
}
else if (desc->ddsCaps.dwCaps2 & DDSCAPS2_TEXTUREMANAGE)
else if (desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))
{
pool = WINED3D_POOL_MANAGED;
/* Managed textures have the system memory flag set. */
......
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