-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
InfiniteList
widget
#160
Comments
We are currently not performing any culling of rendering primitives. We haven't focused much on performance or memory footprint yet. However, it may be worth it to add a layer boundary check here: It should be a matter of checking rectangle intersection. Once images are culled, the renderer cache will automatically deallocate memory of images that fall out of bounds. I will see if I can add that in a bit! However, the deallocation strategy is very simplistic and I have the feeling this will not be enough for a smooth scrolling experience, as the renderer currently loads images using blocking I/O. We should fix that eventually. There is also the fact that we are issuing a draw call per image, instead of using a texture atlas to batch the work (there are some initial efforts in #154). |
It is wonderful! Thanks for supporting this particular use case in this early project. |
Maybe that logic could be handled in the scroll view itself. Make the view somehow instantiate only those widgets that are actually being shown. I know Qt does it like that. |
@Maldela Yes, there are different levels where we can perform optimizations. The renderer one I mentioned is widget-agnostic and culls primitives directly. Therefore, it's more general. It should benefit custom widgets too. Checking boundaries of the children in the As an alternative, we could provide In any case, the renderer optimization should take care of the extreme cases for now. |
I have a I'd think I wouldn't want to push 1k records in the first place, only however many elements are "in view". Any chance of exposing helper methods to calculate how many elements are "in view" and what the current offset is? That way I could just |
@tarkah For this kind of use case, there are plans to create an alternative to EDIT: That application looks cool! 😄 |
Thanks! Perfect, I'll follow progress there. |
@hecrj Would that From a 3D graphics perspective, you won't ever need to resize your vertex buffers except for when the table view grows. Eventually, it'll never grow anymore because that element will typically be within the window's view except for crazy situations when tables need to be nested inside of tables... That's probably on them to figure out though lol. I'm not familiar with Vulkan/wgpu, but I'm guessing GLSL's used under-the-hood all the same, so you should be able to pass all viewable elements' data as a UBO, and have a vertex attribute to associate each quad to the index of the table cell struct in the UBO. Sorry for the crazy wordiness. This looks like an incredibly exciting project. The Rust community needs more UI crates like this :) |
any updates on this? |
@CelestialCrafter there is a branch ( hecrj mentioned that he wanted to fix it / make it better (in the discord), so hopefully we'll see some work on it in the coming months. |
ohh nice, my app is gonna be rendering ~100k images in a list so.. kinda need infinite lists! sucks that it's ~500 commits behind though but whatever! |
I am writing an app that loads more than 400 PNGs into a scroll view.
But, it seems that VRAM is out of memory because too many images are being loaded.
I want to unload images outside the rendering range of the scroll view.
Is there a way to know the display status of children elements in scroll view?
The text was updated successfully, but these errors were encountered: