WineD3D: Do not mark texture stages above MAX_TEXTURES dirty

Stefan Dösinger stefandoesinger at gmx.at
Mon Dec 25 05:43:02 CST 2006


From f139fdd077385ea6e853aa2479d793d50f3dba3f Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Stefan_D=C3=B6singer?= <stefan at imac.local>
Date: Mon, 25 Dec 2006 12:42:15 +0100
Subject: [PATCH] WineD3D: Do not mark texture stages above MAX_TEXTURES dirty

---
 dlls/wined3d/device.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d2d4456..a750a8d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4378,7 +4378,7 @@ #endif
         ULONG bindCount = InterlockedIncrement(&new->baseTexture.bindCount);
 
         IWineD3DBaseTexture_AddRef(This->updateStateBlock->textures[Stage]);
-        if(oldTexture == NULL) {
+        if(oldTexture == NULL && Stage < MAX_TEXTURES) {
             /* The source arguments for color and alpha ops have different meanings when a NULL texture is bound,
              * so the COLOROP and ALPHAOP have to be dirtified.
              */
@@ -4397,7 +4397,7 @@ #endif
         LONG bindCount = InterlockedDecrement(&old->baseTexture.bindCount);
 
         IWineD3DBaseTexture_Release(oldTexture);
-        if(pTexture == NULL) {
+        if(pTexture == NULL && Stage < MAX_TEXTURES) {
             IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(Stage, WINED3DTSS_COLOROP));
             IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TEXTURESTAGE(Stage, WINED3DTSS_ALPHAOP));
         }
-- 
1.4.2.4



More information about the wine-patches mailing list