Skip to content

softgpu: Avoid waiting for a thread to drain - #16102

Merged
hrydgard merged 2 commits into
hrydgard:masterfrom
unknownbrackets:softgpu-bin-tweaks
Sep 25, 2022
Merged

hrydgard merged 2 commits into
hrydgard:masterfrom
unknownbrackets:softgpu-bin-tweaks

Conversation

@unknownbrackets

Copy link
Copy Markdown
Collaborator

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]

We made them smaller, so we can queue more of them in the same space.
Helps a little bit.
If we can, we want to keep the thread queues healthy, but not full.
Reduce the amount we push on a typical drain to avoid the Wait().
@unknownbrackets unknownbrackets added this to the v1.14.0 milestone Sep 25, 2022
@hrydgard
hrydgard merged commit a26a353 into hrydgard:master Sep 25, 2022
@unknownbrackets
unknownbrackets deleted the softgpu-bin-tweaks branch September 25, 2022 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants