Stefan Dösinger : wined3d: Add CTXUSAGE_CLEAR context usage.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jul 10 08:02:32 CDT 2007


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

Author: Stefan Dösinger <stefandoesinger at gmx.at>
Date:   Mon Jul  9 16:57:58 2007 +0200

wined3d: Add CTXUSAGE_CLEAR context usage.

---

 dlls/wined3d/context.c         |   13 +++++++++++++
 dlls/wined3d/device.c          |    7 +------
 dlls/wined3d/wined3d_private.h |    1 +
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 2707407..80f2f31 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -842,6 +842,19 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
             /* This does not require any special states to be set up */
             break;
 
+        case CTXUSAGE_CLEAR:
+            if(context->last_was_blit && GL_SUPPORT(NV_TEXTURE_SHADER2)) {
+                glEnable(GL_TEXTURE_SHADER_NV);
+                checkGLcall("glEnable(GL_TEXTURE_SHADER_NV)");
+            }
+
+            glEnable(GL_SCISSOR_TEST);
+            checkGLcall("glEnable GL_SCISSOR_TEST");
+            context->last_was_blit = FALSE;
+            Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
+            Context_MarkStateDirty(context, STATE_SCISSORRECT);
+            break;
+
         case CTXUSAGE_DRAWPRIM:
             /* This needs all dirty states applied */
             if(context->last_was_blit && GL_SUPPORT(NV_TEXTURE_SHADER2)) {
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index bcca5d7..520a4b3 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4463,12 +4463,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
         apply_fbo_state(iface);
     }
 
-    ActivateContext(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD);
-
-    glEnable(GL_SCISSOR_TEST);
-    checkGLcall("glEnable GL_SCISSOR_TEST");
-    IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SCISSORRECT);
-    IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
+    ActivateContext(This, This->render_targets[0], CTXUSAGE_CLEAR);
 
     if (Count > 0 && pRects) {
         curRect = pRects;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 86cad0b..1169310 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -527,6 +527,7 @@ typedef enum ContextUsage {
     CTXUSAGE_RESOURCELOAD       = 1,    /* Only loads textures: No State is applied */
     CTXUSAGE_DRAWPRIM           = 2,    /* OpenGL states are set up for blitting DirectDraw surfacs */
     CTXUSAGE_BLIT               = 3,    /* OpenGL states are set up 3D drawing */
+    CTXUSAGE_CLEAR              = 4,    /* Drawable and states are set up for clearing */
 } ContextUsage;
 
 void ActivateContext(IWineD3DDeviceImpl *device, IWineD3DSurface *target, ContextUsage usage);




More information about the wine-cvs mailing list