[PATCH] WineD3D: Honor the texcoordindex when setting the =

Stefan Doesinger stefan at codeweavers.com
Tue Jul 22 13:56:07 CDT 2008


texture matrix=0A=
=0A=
---=0A=
 dlls/wined3d/state.c |    6 ++++--=0A=
 1 files changed, 4 insertions(+), 2 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c=0A=
index 9e29d78..a6903c6 100644=0A=
--- a/dlls/wined3d/state.c=0A=
+++ b/dlls/wined3d/state.c=0A=
@@ -3108,6 +3108,7 @@ static void transform_texture(DWORD state, =
IWineD3DStateBlockImpl *stateblock, W=0A=
     DWORD texUnit =3D state - STATE_TRANSFORM(WINED3DTS_TEXTURE0);=0A=
     DWORD mapped_stage =3D =
stateblock->wineD3DDevice->texUnitMap[texUnit];=0A=
     BOOL generated;=0A=
+    int coordIdx;=0A=
 =0A=
     /* Ignore this when a vertex shader is used, or if the streams =
aren't sorted out yet */=0A=
     if(use_vs(stateblock->wineD3DDevice) ||=0A=
@@ -3130,13 +3131,14 @@ static void transform_texture(DWORD state, =
IWineD3DStateBlockImpl *stateblock, W=0A=
         return;=0A=
     }=0A=
     generated =3D =
(stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX] & =
0xFFFF0000) !=3D WINED3DTSS_TCI_PASSTHRU;=0A=
+    coordIdx =3D =
min(stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX & =
0x0000FFFF], MAX_TEXTURES - 1);=0A=
 =0A=
     set_texture_matrix(&stateblock->transforms[WINED3DTS_TEXTURE0 + =
texUnit].u.m[0][0],=0A=
                         =
stateblock->textureState[texUnit][WINED3DTSS_TEXTURETRANSFORMFLAGS],=0A=
                         generated,=0A=
                         context->last_was_rhw,=0A=
-                        =
stateblock->wineD3DDevice->strided_streams.u.s.texCoords[texUnit].dwStrid=
e ?=0A=
-                            =
stateblock->wineD3DDevice->strided_streams.u.s.texCoords[texUnit].dwType:=0A=
+                        =
stateblock->wineD3DDevice->strided_streams.u.s.texCoords[coordIdx].dwStri=
de ?=0A=
+                            =
stateblock->wineD3DDevice->strided_streams.u.s.texCoords[coordIdx].dwType=
:=0A=
                             WINED3DDECLTYPE_UNUSED);=0A=
 =0A=
     /* The sampler applying function calls us if this changes */=0A=
-- =0A=
1.5.4.5=0A=
=0A=

------=_NextPart_000_0013_01C8ECB6.0663DCB0--




More information about the wine-patches mailing list