-
Notifications
You must be signed in to change notification settings - Fork 382
Description
I've been optimising how i create RmlUi textures by loading them into an atlas. This has been marvelous for performance, as it caches styles that aren't changing, and when recreating it's fast. However i've noticed that despite differing elements being visually identical, rmlui saves each image seperately?
This is a view of my texture atlas at some point in time.

Since i have many elements that have a box-shadow effect, rmlui seems to save each one seperately. Moreover, since the box-shadow does not save anything about the backdrop-filter or anything (so no baked in blur or anything), i dont see why it needs to recreate the texture for each element?
I propose that maybe for each element, compute some sort of hash based on the properties whenever they change, so that it can reuse other elements with the same properties whenever possible, reducing memory usage and resource creation, however I'm not sure if this could break other important behaviour.