mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
[renderer] Boost R_MarkLeaves very slightly
Using set iterators can be quite a lot faster for sparse sets due to the function call overhead in testing each element. Times for ad_tears dropped from about 1200us to about 670us (hard to say due to there being only 3 data points and a lot of noise in the time).
This commit is contained in:
parent
1f99f89a4a
commit
f7fce957e8
1 changed files with 2 additions and 1 deletions
|
@ -77,7 +77,8 @@ R_MarkLeaves (visstate_t *visstate, const mleaf_t *viewleaf)
|
|||
vis = Mod_LeafPVS (viewleaf, brush);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < brush->visleafs; i++) {
|
||||
for (auto li = set_first (vis); li; li = set_next (li)) {
|
||||
unsigned i = li->element;
|
||||
if (set_is_member (vis, i)) {
|
||||
leaf = &brush->leafs[i + 1];
|
||||
if ((c = leaf->nummarksurfaces)) {
|
||||
|
|
Loading…
Reference in a new issue