[dx97] rhw mode vs GL drawings

Jason Edmeades us at the-edmeades.demon.co.uk
Sun Nov 16 16:57:50 CST 2003


In RHW mode, the 'w' parm is for perspective only and doesnt impace the 
drawing location whereas in GL it does. In non-rhw mode (vertex shader 
output) we need to keep the w parm as-is. Unfortunately in fast mode 
there is no way to acheive this, but the effects should be very minimal, 
so in the current time disable the 'w' in rhw mode.

Long term we might want to look at a dummy vertex shader to reverse RGB 
and multiply through by 'w' to convert slow into fast mode if vs support 
is available?

Changelog

Disable the use of the 'w' parm in rhw mode

Jason
-------------- next part --------------
diff -u3 dlls/d3d8/dx96/drawprim.c dlls/d3d8/drawprim.c
--- dlls/d3d8/dx96/drawprim.c	2003-11-16 14:23:42.000000000 +0000
+++ dlls/d3d8/drawprim.c	2003-11-16 15:12:01.000000000 +0000
@@ -660,7 +660,12 @@
                 sd->u.s.position.dwStride, 
                 sd->u.s.position.dwType + 1, 
                 sd->u.s.position.lpData));
-        glVertexPointer(sd->u.s.position.dwType + 1, GL_FLOAT, 
+
+        /* Disable RHW mode as 'w' coord handling for rhw mode should
+           not impact screen position whereas in GL it does. This may 
+           result in very slightly distored textures in rhw mode, but
+           a very minimal different                                   */
+        glVertexPointer(3, GL_FLOAT,  /* RHW: Was 'sd->u.s.position.dwType + 1' */
                         sd->u.s.position.dwStride, 
                         sd->u.s.position.lpData);
         checkGLcall("glVertexPointer(...)");
@@ -1196,7 +1201,12 @@
                 glVertex3f(x, y, z);
             } else {
                 VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw));
-                glVertex4f(x,y,z,rhw);
+                /* Disable RHW mode as 'w' coord handling for rhw mode should
+                   not impact screen position whereas in GL it does. This may 
+                   result in very slightly distored textures in rhw mode, but
+                   a very minimal different. In slow mode a possible 'fix' is
+                   glVertex4f(x*rhw,y*rhw,z*rhw,rhw) but not sure this is right */
+                glVertex3f(x,y,z);
             }
         }
 



More information about the wine-patches mailing list