Currently, drawing indexed quads is implemented by doing a draw call for each quad (drawing two triangles instead). This was done to avoid a conversion of the index buffer, but has as downside being very slow.
Therefore, re-implement this draw type, by converting the index buffer, so that quads are approximated by triangles.
This requires an index buffer cache, otherwise the above mentioned slowdown would still be present, but then caused by repeated conversions of index buffers.
Note, that approximating quads with triangles produces slightly distorted rendering - see here for one such case (and the solution) : https://www.reddit.com/r/emulation/comments/78azl5/quadrangles/
(http://reedbeta.com/blog/quadrilateral-interpolation-part-2/ )
For some games, this change will be enough to increase them from snail-speed (1-8fps) to fully playable: so it is quite important.
All related code can be found by searching for X_D3DPT_QUADLIST in draw-functions. This results in four functions;
The ones in D3DDevice_DrawVertices and CxbxDrawPrimitiveUP are already optimized (they draw quadlists using a single 'quad-to-triangle mapping' index buffer).
The ones that need to be refactored are : D3DDevice_DrawIndexedVerticesUP and CxbxDrawIndexed.
Fixed by PR #1757
Most helpful comment
For some games, this change will be enough to increase them from snail-speed (1-8fps) to fully playable: so it is quite important.