Roderick Colenbrander : wined3d: Disable framebuffer to texture blitting.

Alexandre Julliard julliard at winehq.org
Tue Apr 6 11:20:08 CDT 2010


Module: wine
Branch: master
Commit: a5a4be4fc54bb4bfb860bdfd98cd241785027797
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a5a4be4fc54bb4bfb860bdfd98cd241785027797

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Mon Apr  5 20:05:16 2010 +0200

wined3d: Disable framebuffer to texture blitting.

The current code doesn't work for this at all and causes major
rendering issues in e.g. C&C. I don't think we should fix this code
either since it isn't worth the effort and requires evil things like
paletteOverride.

---

 dlls/wined3d/surface.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 95889e4..a863372 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3894,7 +3894,14 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
     if((srcSwapchain || SrcSurface == myDevice->render_targets[0]) && !dstSwapchain) {
         /* Blit from render target to texture */
         BOOL stretchx;
-        BOOL paletteOverride = FALSE;
+
+        /* P8 read back is not implemented */
+        if (Src->resource.format_desc->format == WINED3DFMT_P8_UINT ||
+            This->resource.format_desc->format == WINED3DFMT_P8_UINT)
+        {
+            TRACE("P8 read back not supported by frame buffer to texture blit\n");
+            return WINED3DERR_INVALIDCALL;
+        }
 
         if(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) {
             TRACE("Color keying not supported by frame buffer to texture blit\n");
@@ -3908,15 +3915,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
             stretchx = FALSE;
         }
 
-        /* When blitting from a render target a texture, the texture isn't required to have a palette.
-         * In this case grab the palette from the render target. */
-        if (This->resource.format_desc->format == WINED3DFMT_P8_UINT && !This->palette)
-        {
-            paletteOverride = TRUE;
-            TRACE("Source surface (%p) lacks palette, overriding palette with palette %p of destination surface (%p)\n", Src, This->palette, This);
-            This->palette = Src->palette;
-        }
-
         /* Blt is a pretty powerful call, while glCopyTexSubImage2D is not. glCopyTexSubImage cannot
          * flip the image nor scale it.
          *
@@ -3947,10 +3945,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
             fb_copy_to_texture_hwstretch(This, SrcSurface, &src_rect, &dst_rect, Filter);
         }
 
-        /* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
-        if(paletteOverride)
-            This->palette = NULL;
-
         if(!(This->Flags & SFLAG_DONOTFREE)) {
             HeapFree(GetProcessHeap(), 0, This->resource.heapMemory);
             This->resource.allocatedMemory = NULL;




More information about the wine-cvs mailing list