wined3d: Fix does not clip transformed vertices in z-direction

Антон Ярцев thunder_8888 at
Wed Aug 10 10:35:31 CDT 2011

In some d3d9 2d-games, some sprites does not draws, or draws like thin line because game use transformation for primitives, and  z-coordinate(detected ~ -700...+700 range) of vertices might be not in view volume as occurs.
According to MSDN ( "Viewports and Clipping (Direct3D 9)":
Direct3D does not clip transformed vertices of a primitive from a vertex buffer unless it comes from IDirect3DDevice9::ProcessVertices. If you are doing your own transforms and need Direct3D to do the clipping, you should not use vertex buffers. In this case, the application traverses the data to transform it. Direct3D traverses the data a second time to clip it, and then the driver renders the data, which is inefficient. So, if the application transforms the data, is should also clip the data.

P.S. 10000 and -10000 is a big values, but how i think, it's must be half of maximum positive and negative values which allows opengl use as near and far. Or wine should tracks "transformed vertices of a primitive from a vertex buffer" and modify z-values of vertices to 0~1 range.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/x-patch
Size: 1048 bytes
Desc: not available
URL: <>

More information about the wine-patches mailing list