http://bugs.winehq.org/show_bug.cgi?id=24009
--- Comment #21 from Stefan Dösinger stefandoesinger@gmx.at 2011-07-30 07:41:01 CDT --- Clipping in ProcessVertices is indeed not fully implemented. Clipping when drawing is implemented because OpenGL always clips.
Clipping in ProcessVertices is trickier than the attached patch because clipping has to be done on full primitives(triangles, lines) rather than single vertices. ProcessVertices however doesn't know about the primitive assembly, it just operates on vertices.
According to the msdn[1], ProcessVertices stores a list of clipped triangles inside the vertex buffer, which is hidden from the application. When this vertex buffer is used for drawing, the draw function(which knows about the primitive assembly) uses this list to clip the primitives(which may mean that a triangle is split into two triangles).
Your patch is wrong in two ways: first, doClip is only false because it is forced to FALSE a couple of lines earlier in process_vertices_strided. The proper way is to disable the hack there. We also need a test for d3d8 and d3d9, those dll's ProcessVertices methods aren't tested yet.
With the hack disabled, a list of clipped vertices has to be added to the buffer. In case this list is non-empty, drawing has to go through drawStridedSlow. There won't be any vertex shaders involved because RHW vertices bypass the vertex pipeline. A clipping algorithm(look the details up in the CG book of your choice) has to be added to drawStridedSlow to emit properly clipped triangles(or lines). For POINTLIST draws nothing special has to be done I think.
1: http://msdn.microsoft.com/en-us/library/bb174424(v=vs.85).aspx