Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cached alpha mode instead of calling surface.get_capabilities every time the window is redrawn #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Adam-Cosner
Copy link

This somewhat improves performance on resizing by using the cached self.alpha_mode on the wgpu backend instead of calling surface.get_capabilities every time, which results in a roughly 50% reduction in resize draw time.

Note: resizing is still somewhat choppy and I've traced it to surface.configure in the same function, though I cannot figure out why this takes many times longer to run than base iced. If I figure it out, I'll let y'all know

@Adam-Cosner
Copy link
Author

Okay, after some further investigation, I think I've figured it out. Basically, because we're skipping the discrete GPU, resizing performance is going to be choppy no matter what you do IF YOU ARE USING THE WGPU BACKEND. The WGPU backend is intended for high performance situations where hardware acceleration is necessary, so it shouldn't be used in normal GUI applications. The reason it's so choppy in the WGPU backend is because it's telling the integrated GPU to reallocate the frame buffers every single frame that the resize is called, which is an expensive process. So I think WGPU shouldn't be used for most libcosmic apps

@skygrango
Copy link

I happened to be testing a similar problem

I just suddenly thought if we provide a way to specify a fixed size buffer, then if the user exceeds the resolution range, only upscaling will be applied, and if the user zooms out, only a portion of the buffer will be used. Is this idea feasible? It might be better if this special mode and fixed size can be set dynamically, so developers can control expected behavior, and users can also override their own desired resource consumption.

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