livesplit-core icon indicating copy to clipboard operation
livesplit-core copied to clipboard

Add brushes as resources to the scene manager

Open CryZe opened this issue 3 years ago • 2 comments

As it turns out, creating brushes is actually quite expensive with a lot of rendering backends. So we definitely want to only create them once and then just attach them to the individual entities.

CryZe avatar Jun 10 '21 08:06 CryZe

I think we should globally cache solid color shaders because there's likely to be a lot of them that are mostly identical. The other shaders all depend on width and height so tbey should probably belong to a local cache, but for the color shaders I see no harm in just having a lazy_static lru cache somewhere with a reasonable size.

Hurricane996 avatar Jun 06 '22 23:06 Hurricane996

although checking again it appears the solid color shaders are also by far the least computationally expensive, to the point where caching it is probably not even worth it.

Hurricane996 avatar Jun 06 '22 23:06 Hurricane996