softgpu: Avoid waiting for a thread to drain #16102
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes we have so many triangles, it fills up our queue and we have to stall to wait for the thread to have space, which is slow. It doesn't happen that often, but it happens in some heavier games.
This increases the queue size (there's a limit; too large and it just gets slower), and also tries to avoid complete drains from the main queue onto the threads. This seems to avoid the syncs sometimes and increases some cases by a couple percent.
There's probably better heuristics here. It's tricky though, everything I change in binning has significant and hard to predict effects. I think ideal tuning of it is one of the areas that could lead to the most gain in performance left (much more than this change), though.
-[Unknown]