[PATCH 4/5] wined3d: Make sure we have an active GL context before calling d3dfmt_p8_upload_palette().

Henri Verbeet hverbeet at codeweavers.com
Fri Jun 26 03:07:11 CDT 2009


---
 dlls/wined3d/surface.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e3070d2..bac2fe5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4094,6 +4094,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
 
         if((This->resource.usage & WINED3DUSAGE_RENDERTARGET) && (convert == NO_CONVERSION))
         {
+            IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
+
             /* Make sure the texture is up to date. This call doesn't do anything if the texture is already up to date. */
             IWineD3DSurface_LoadLocation(iface, SFLAG_INTEXTURE, NULL);
 
@@ -4101,6 +4103,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
             IWineD3DSurface_ModifyLocation(iface, SFLAG_INDRAWABLE, FALSE);
 
             /* Re-upload the palette */
+            ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
             d3dfmt_p8_upload_palette(iface, convert);
         } else {
             if(!(This->Flags & SFLAG_INSYSMEM)) {
-- 
1.6.0.6




More information about the wine-patches mailing list