H. Verbeet : wined3d: Skip NULL textures rather than non-NULL ones, assign -1 to skipped stages.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Dec 26 06:49:29 CST 2006


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

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Mon Dec 25 23:02:41 2006 +0100

wined3d: Skip NULL textures rather than non-NULL ones, assign -1 to skipped stages.

Downgrade a FIXME to a WARN.

---

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4966d0c..0ad4512 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3735,15 +3735,26 @@ static void IWineD3DDeviceImpl_FindTexUn
         /* Now work out the mapping */
         tex = 0;
         This->oneToOneTexUnitMap = FALSE;
-        FIXME("Non 1:1 mapping UNTESTED!\n");
+        WARN("Non 1:1 mapping UNTESTED!\n");
         for(i = 0; i < This->stateBlock->lowest_disabled_stage; i++) {
-            if(This->stateBlock->textures[i] == NULL) tex++;
+            /* Skip NULL textures */
+            if (!This->stateBlock->textures[i]) {
+                /* Map to -1, so the check below doesn't fail if a non-NULL
+                 * texture is set on this stage */
+                TRACE("Mapping texture stage %d to -1\n", i);
+                This->texUnitMap[i] = -1;
+
+                continue;
+            }
+
             TRACE("Mapping texture stage %d to unit %d\n", i, tex);
             if(This->texUnitMap[i] != tex) {
                 This->texUnitMap[i] = tex;
                 IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(i));
                 markTextureStagesDirty(This, i);
             }
+
+            ++tex;
         }
     }
 }




More information about the wine-cvs mailing list