Module: wine Branch: master Commit: 5c4d3fb5a21210f48dfb7d9c0af8a91b23dc7ac4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5c4d3fb5a21210f48dfb7d9c0a...
Author: Stefan Dösinger stefan@codeweavers.com Date: Mon Feb 15 12:30:37 2010 +0100
wined3d: Control SFLAG_CONVERTED in surface_prepare_texture.
This makes sure that the flag is set correctly when surface_allocate_surface is called and client storage is disabled properly for converted surfaces.
---
dlls/wined3d/surface.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 1a37fb1..d5d2246 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1265,6 +1265,9 @@ void surface_prepare_texture(IWineD3DSurfaceImpl *surface, BOOL srgb) if (surface->Flags & alloc_flag) return;
d3dfmt_get_conv(surface, TRUE, TRUE, &format, &internal, &type, &convert, &bpp, srgb); + if(convert != NO_CONVERSION) surface->Flags |= SFLAG_CONVERTED; + else surface->Flags &= ~SFLAG_CONVERTED; + if ((surface->Flags & SFLAG_NONPOW2) && !(surface->Flags & SFLAG_OVERSIZE)) { width = surface->pow2Width; @@ -5060,17 +5063,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D return WINED3DERR_OUTOFVIDEOMEMORY; } d3dfmt_convert_surface(This->resource.allocatedMemory, mem, pitch, width, height, outpitch, convert, This); - - This->Flags |= SFLAG_CONVERTED; } else if (This->resource.format_desc->format == WINED3DFMT_P8_UINT && (gl_info->supported[EXT_PALETTED_TEXTURE] || gl_info->supported[ARB_FRAGMENT_PROGRAM])) { d3dfmt_p8_upload_palette(iface, convert); - This->Flags &= ~SFLAG_CONVERTED; mem = This->resource.allocatedMemory; } else { - This->Flags &= ~SFLAG_CONVERTED; mem = This->resource.allocatedMemory; }