[PATCH 1/4] wined3d: set conversion flags for format descriptors having a convert function

Roderick Colenbrander thunderbird2k at gmail.com
Mon May 17 06:11:38 CDT 2010


This is a resubmit of the patch from Friday but with an updated ChangeLog.
I agree with Henri that the second check in LoadLocation can be avoided but there
some other bugs related to that. For now this patch restores the original behavior
before I added desc.convert.
---
 dlls/wined3d/surface.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index db4a58b..193260e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1568,7 +1568,7 @@ static void surface_prepare_texture_internal(IWineD3DSurfaceImpl *surface,
     if (surface->Flags & alloc_flag) return;
 
     d3dfmt_get_conv(surface, TRUE, TRUE, &desc, &convert);
-    if(convert != NO_CONVERSION) surface->Flags |= SFLAG_CONVERTED;
+    if(convert != NO_CONVERSION || desc.convert) surface->Flags |= SFLAG_CONVERTED;
     else surface->Flags &= ~SFLAG_CONVERTED;
 
     surface_bind_and_dirtify(surface, srgb);
@@ -4554,7 +4554,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
 
             /* Don't use PBOs for converted surfaces. During PBO conversion we look at SFLAG_CONVERTED
              * but it isn't set (yet) in all cases it is getting called. */
-            if((convert != NO_CONVERSION) && (This->Flags & SFLAG_PBO)) {
+            if(((convert != NO_CONVERSION) || desc.convert) && (This->Flags & SFLAG_PBO)) {
                 TRACE("Removing the pbo attached to surface %p\n", This);
                 surface_remove_pbo(This, gl_info);
             }
-- 
1.6.3.3




More information about the wine-patches mailing list