Changelog
The'w' component is used more than just for the vertex, so we cannot do the projection mapping ourselves. Also tidy up a tracepoint, and preinitialize the shaders output as windows seems to.
Jason
Index: dlls/d3d8/directx.c =================================================================== RCS file: /home/wine/wine/dlls/d3d8/directx.c,v retrieving revision 1.52 diff -u -r1.52 directx.c --- dlls/d3d8/directx.c 19 Sep 2003 00:20:19 -0000 1.52 +++ dlls/d3d8/directx.c 20 Sep 2003 21:07:52 -0000 @@ -1152,7 +1152,7 @@ object->view_ident = 1; object->last_was_rhw = 0; - TRACE("(%p,%d) All defaults now set up, leaving CreateDevice\n", This, Adapter); + TRACE("(%p,%d) All defaults now set up, leaving CreateDevice with %p\n", This, Adapter, object); return D3D_OK; } Index: dlls/d3d8/drawprim.c =================================================================== RCS file: /home/wine/wine/dlls/d3d8/drawprim.c,v retrieving revision 1.10 diff -u -r1.10 drawprim.c --- dlls/d3d8/drawprim.c 19 Sep 2003 00:07:34 -0000 1.10 +++ dlls/d3d8/drawprim.c 20 Sep 2003 21:07:55 -0000 @@ -623,9 +623,10 @@ VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f\n", x,y,z)); glVertex3f(x, y, z); } else { - GLfloat w = 1.0f / rhw; + /* Cannot optimize by dividing through by rhw as rhw is required + later for perspective in the GL pipeline for vertex shaders */ VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw)); - glVertex4f(x * w, y * w, z * w, 1.0f); + glVertex4f(x,y,z,rhw); } } } @@ -1189,7 +1190,7 @@ glVertex3f(x, y, z); } else { VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw)); - glVertex4f(x / rhw, y / rhw, z / rhw, 1.0f / rhw); + glVertex4f(x,y,z,rhw); } } @@ -1265,8 +1266,14 @@ /* Fill the vertex shader input */ IDirect3DDeviceImpl_FillVertexShaderInput(This, vertex_shader, SkipnStrides); - /* Now execute the vertex shader */ + /* Initialize the output fields to the same defaults as it would normally have */ memset(&vertex_shader->output, 0, sizeof(VSHADEROUTPUTDATA8)); + vertex_shader->output.oD[0].x = 1.0; + vertex_shader->output.oD[0].y = 1.0; + vertex_shader->output.oD[0].z = 1.0; + vertex_shader->output.oD[0].w = 1.0; + + /* Now execute the vertex shader */ IDirect3DVertexShaderImpl_ExecuteSW(vertex_shader, &vertex_shader->input, &vertex_shader->output); /*