[PATCH] Drawprim completion with corrected parm handler

Chris Ahrendt celticht32 at aol.com
Wed Sep 10 23:36:14 CDT 2008


---
 dlls/wined3d/drawprim.c |   60 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 80aaf02..9eb8681 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -295,6 +295,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
     UINT *streamOffset = This->stateBlock->streamOffset;
     long                      SkipnStrides = startVertex + This->stateBlock->loadBaseVertexIndex;
     BOOL                      pixelShader = use_ps(This);
+    int parmsUse = 0;
 
     BYTE *texCoords[WINED3DDP_MAXTEXCOORD];
     BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL;
@@ -447,27 +448,62 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
                     if (texture_idx == -1) continue;
 
                     /* The coords to supply depend completely on the fvf / vertex shader */
+                    /* 
+                      decltype:                   coordsToUse:
+                      1        D3DDECLTYPE_FLOAT1          1
+                      2        D3DDECLTYPE_FLOAT2          2
+                      3        D3DDECLTYPE_FLOAT3          3
+                      4        D3DDECLTYPE_FLOAT4          4
+                      5        D3DDECLTYPE_D3DCOLOR        4
+                      6        D3DDECLTYPE_UBYTE4          4
+                      7        D3DDECLTYPE_SHORT2          2
+                      8        D3DDECLTYPE_SHORT4          4
+                      9        D3DDECLTYPE_UBYTE4N         4
+                      10       D3DDECLTYPE_SHORT2N         2
+                      11       D3DDECLTYPE_SHORT4N         4
+                      12       D3DDECLTYPE_USHORT2N        2
+                      13       D3DDECLTYPE_USHORT4N        4
+                      14       D3DDECLTYPE_UDEC3           3
+                      15       D3DDECLTYPE_DEC3N           3
+                      16       D3DDECLTYPE_FLOAT16_2       2
+                      17       D3DDECLTYPE_FLOAT16_4       4
+                    */
                     switch (coordsToUse) {
-                    case 16:
-                    case 15:
-                    case 14:
+                    case 17:
                     case 13:
-                    case 12:
                     case 11:
-                    case 10:
                     case  9:
                     case  8:
-                    case  7:
                     case  6:
-                    case  5:
-                    case  4: q = ptrToCoords[3]; /* drop through */
-                    case  3: r = ptrToCoords[2]; /* drop through */
-                    case  2: t = ptrToCoords[1]; /* drop through */
+                    case  4: q = ptrToCoords[3];
+                             r = ptrToCoords[2];
+                             t = ptrToCoords[1];
+                             s = ptrToCoords[0];
+                             parmsUse = 4;
+                             break;
+                    case 15:
+                    case 14:
+                    case  3: r = ptrToCoords[2];
+                             t = ptrToCoords[1];
+                             s = ptrToCoords[0];
+                             parmsUse = 3;
+                             break;
+                    case 16:
+                    case 12:
+                    case 10:
+                    case  7:
+                    case  2: t = ptrToCoords[1];
+                             s = ptrToCoords[0];
+                             parmsUse = 2;
+                             break;
                     case  1: s = ptrToCoords[0];
+                             parmsUse = 1;
+                             break;
+                    default: parmsUse = 0;
+                             break;
                     }
 
-                    if (coordsToUse > 4) coordsToUse = 4;
-                    switch (coordsToUse) {   /* Supply the provided texture coords */
+                    switch (parmsUse) {   /* Supply the provided texture coords */
                     case WINED3DTTFF_COUNT1:
                         VTRACE(("tex:%d, s=%f\n", textureNo, s));
                         if (GL_SUPPORT(ARB_MULTITEXTURE)) {
-- 
1.5.5.1


--------------060409030201080600090707--



More information about the wine-patches mailing list