Alexander Dorofeyev : wined3d: Add ActivateContext in color_fill_fbo.

Alexandre Julliard julliard at winehq.org
Wed Jul 30 08:36:01 CDT 2008


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

Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date:   Wed Jul 30 01:24:43 2008 +0300

wined3d: Add ActivateContext in color_fill_fbo.

Also removes dirtifying of SCISSORTESTENABLE state that is made
redundant by ActivateContext(...,CTXUSAGE_CLEAR).

---

 dlls/wined3d/device.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0a6bd2b..de3a93f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -6182,12 +6182,17 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONS
 
         TRACE("Surface %p is onscreen\n", surface);
 
+        ActivateContext(This, surface, CTXUSAGE_CLEAR);
+        ENTER_GL();
         GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0));
         buffer = surface_get_gl_buffer(surface, swapchain);
         glDrawBuffer(buffer);
         checkGLcall("glDrawBuffer()");
     } else {
         TRACE("Surface %p is offscreen\n", surface);
+
+        ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_CLEAR);
+        ENTER_GL();
         bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->dst_fbo);
         attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, surface);
         GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0));
@@ -6206,7 +6211,6 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONS
     } else {
         glDisable(GL_SCISSOR_TEST);
     }
-    IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
 
     glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
     IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_COLORWRITEENABLE));
@@ -6227,6 +6231,8 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONS
         glDrawBuffer(GL_BACK);
         checkGLcall("glDrawBuffer()");
     }
+
+    LEAVE_GL();
 }
 
 static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
@@ -6348,9 +6354,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD
     }
 
     if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
-        ENTER_GL();
         color_fill_fbo(iface, pSurface, pRect, color);
-        LEAVE_GL();
         return WINED3D_OK;
     } else {
         /* Just forward this to the DirectDraw blitting engine */




More information about the wine-cvs mailing list