-
Notifications
You must be signed in to change notification settings - Fork 183
[macOS] full screen is super slow #72
Comments
Great, thanks for the update! |
Now that the swapchain recreation issue is resolved, I still see this behavior with full screen. The only info I have to add here is that dragging the corners of the window (e.g. on the shadow example) to the maximum size only uses about 25% CPU. When I press the green fullscreen button it's suddenly CPU bound using just over 100% CPU. Even though the physical size is extremely close, there is something horrible going on that is not obvious from logging. 25% CPU, stretch window:
105% CPU, fullscreen:
Here are some logs from the transition to fullscreen. Nothing else stands out as relevant: https://gist.github.com/parasyte/de9695f8322bf4fd92fb70eddf3f0c0a |
Could somebody just make a good Instruments CPU capture and see what we are doing in those 100%? |
Yeah, I just started looking into instruments recently for debugging ill see what I can do within the next few days. |
Here's what I got: profiles.zip
|
If I'm reading the profiles correctly, this nested iteration can be super heavy: https://github.com/gfx-rs/wgpu/blob/499bf1d2686ad25b5a5133d6433e4f4c9179ff0b/wgpu-native/src/device.rs#L379-L395 WDYT? |
Thank you for sharing the profiles! Also, we could possibly optimize this inner loop out: for a in &self.active {
if a.resources.iter().any(|&(ref id, _)| id == res_id) {
last_submit = last_submit.max(a.index);
}
} I don't understand though how this code is different between windowed and fullscreen - it's supposed to do exactly the same thing. |
Alright, I did some profiling locally and I think I found all the wrongs we do:
|
Fixed in |
Previously in gfx-rs/wgpu#78 mentioned that full screen leaks memory and is super slow, but now it's just slow, no longer leaks memory.
I don't see excessive swapchain recreation, it just slow on its own. I haven't checked a trace yet but will do that eventually.
The text was updated successfully, but these errors were encountered: