H. Verbeet : wined3d: Call IWineD3DDeviceImpl_FindTexUnitMap() when activating the context.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jun 13 06:14:03 CDT 2007


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

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Tue Jun 12 23:08:22 2007 +0200

wined3d: Call IWineD3DDeviceImpl_FindTexUnitMap() when activating the context.

---

 dlls/wined3d/context.c         |    3 +++
 dlls/wined3d/device.c          |   21 +--------------------
 dlls/wined3d/wined3d_private.h |    1 +
 3 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index c2834c7..ee9e96e 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -801,6 +801,9 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
                 glEnable(GL_TEXTURE_SHADER_NV);
                 checkGLcall("glEnable(GL_TEXTURE_SHADER_NV)");
             }
+            if (GL_SUPPORT(NV_REGISTER_COMBINERS)) {
+                IWineD3DDeviceImpl_FindTexUnitMap(This);
+            }
             for(i=0; i < context->numDirtyEntries; i++) {
                 dirtyState = context->dirtyArray[i];
                 idx = dirtyState >> 5;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d4a9f77..ab38a7c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3212,7 +3212,7 @@ static inline void markTextureStagesDirty(IWineD3DDeviceImpl *This, DWORD stage)
     }
 }
 
-static void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This) {
+void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This) {
     DWORD i, tex;
     /* This code can assume that GL_NV_register_combiners are supported, otherwise
      * it is never called.
@@ -3307,11 +3307,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShader(IWineD3DDevice *iface, I
     TRACE("(%p) : setting pShader(%p)\n", This, pShader);
     IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADER);
 
-    /* Rebuild the texture unit mapping if nvrc's are supported */
-    if(GL_SUPPORT(NV_REGISTER_COMBINERS)) {
-        IWineD3DDeviceImpl_FindTexUnitMap(This);
-    }
-
     return WINED3D_OK;
 }
 
@@ -3999,13 +3994,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *if
 
     IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(Stage, Type));
 
-    /* Rebuild the stage -> gl texture unit mapping if register combiners are supported
-     * If there is a pixel shader there will be a 1:1 mapping, no need to touch it. SetPixelShader
-     * will call FindTexUnitMap too.
-     */
-    if(GL_SUPPORT(NV_REGISTER_COMBINERS) && !This->stateBlock->pixelShader) {
-        IWineD3DDeviceImpl_FindTexUnitMap(This);
-    }
     return WINED3D_OK;
 }
 
@@ -4113,13 +4101,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
 
     IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(Stage));
 
-    /* Verify the texture unit mapping(and rebuild it if needed) if we use nvrcs and no
-     * pixel shader is used
-     */
-    if(GL_SUPPORT(NV_REGISTER_COMBINERS) && !This->stateBlock->pixelShader) {
-        IWineD3DDeviceImpl_FindTexUnitMap(This);
-    }
-
     return WINED3D_OK;
 }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6673bc0..49081b1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -745,6 +745,7 @@ struct IWineD3DDeviceImpl
 
 extern const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl;
 
+void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This);
 void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state);
 static inline BOOL isStateDirty(WineD3DContext *context, DWORD state) {
     DWORD idx = state >> 5;




More information about the wine-cvs mailing list