This submission is practically identical to [Vijay Kiran Kamuju's improved version](https://list.winehq.org/mailman3/hyperkitty/list/wine-devel(a)winehq.org/mes...) of [Christian Costa's D3DXOptimizeVertices patch in Staging](https://github.com/wine-staging/wine-staging/blob/master/patches/d3dx9_36-D3...). The only changes I made were adding the "Vertex order will not be optimal" message to match [the similar message in D3DXOptimizeFaces](https://gitlab.winehq.org/wine/wine/-/blob/eeabbe812ffc3ed7c06fc85cd63f0d85b...), removing the extra newlines around the function, and changing `%x` to `%lx` in the tests to resolve warnings. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47776 Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6772