Skip to content

Optimise saved texture usage for properies such as box-shadowΒ #799

@ZilverBlade

Description

@ZilverBlade

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.
Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance suggestions or specific issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions