From e91fbb754f7eb25084b2b5d10acf76abadbd8019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 15 Feb 2010 12:30:37 +0100 Subject: [PATCH 01/11] 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; } -- 1.6.4.4