Skip to content

Conversation

@shinyquagsire23
Copy link
Contributor

Avoids some nasty GPU scheduling spikes if the stats graph is left open or something decides to redraw the window while a game is running, at the cost of CPU performance (but only on redraws).

Swaps the eframe renderer to use wgpu, and adds an adapter selection callback. The adapter selection just looks for anything on the CPU, so in theory it should actually work on Linux with llvmpipe, but if no CPU renderers are available it will fall back to the first compatible adapter it finds. Every Windows machine comes with DX12 WARP so it should always find a CPU renderer on Windows.

Copy link
Member

@zmerp zmerp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good

@shinyquagsire23
Copy link
Contributor Author

I'll note down that the Statistics graph for wgpu really seems to chug compared to glow w/ WARP (it uh, kinda gets to a 1Hz update rate on its own lol). Seems to be related to the number of history samples. But it was taking 1ms of GPU before on a 5090 so it wasn't exactly performant in the first place, and DX12 WARP seems to clamp the CPU utilization to 10% at most which is probably for the best here. So we might need a Stats graph overhaul in the near-ish future, or just clamp it to 1Hz and find a way to cache the graph itself in a way that's slightly friendlier to wgpu when scrolling.

The rest of the UI is snappy though, so it's just the Stats graph that lags.

@zmerp
Copy link
Member

zmerp commented Nov 12, 2025

it uh, kinda gets to a 1Hz update rate on its own lol

This is not good. We cannot merge this change like this. We should fix this or approach it in a different way (instead of switching to the software renderer, we throttle the graphs updates). In either case we should probably have a setting to control this

@shinyquagsire23
Copy link
Contributor Author

I'll see if I can at least narrow down what's causing it to struggle so much, I don't think lowering the update rate will help because it seems like it's the rendering itself lagging (ie, if you scrolled it would still be repainting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants