This pull request was originally optimization related since defining vertex formats was performing poorly until #1372 was merged. Now the pull request is just being left open as a proposed API. The idea behind this is to make it easy to define a simple vertex format and is inspired by Direct3D's now-deprecated Flexible Vertex Formats.
The pull request adds the
vertex_format_define function which accepts a combination of
cvf_* constants and returns an id to a vertex format created from the flags. The function is generic and also has a redundant cache to make it even faster to create a common vertex format (e.g, just position and color or other formats I consider "simple" or "common").
The pull request also overloads the 2D and 3D primitive drawing functions to accept an id of a vertex format describing the primitive about to be drawn. This would theoretically be quicker when the format is known ahead of time so the
d3d_model_* class won't have to "guess" the format of the primitive. These changes could also be separated out from the rest of this pull request as they are not closely related.
@@ Coverage Diff @@ ## master #1369 +/- ## ========================================== + Coverage 16.74% 17.16% +0.42% ========================================== Files 164 164 Lines 17095 17121 +26 ========================================== + Hits 2862 2939 +77 + Misses 14233 14182 -51
|Impacted Files||Coverage Δ|