2D: Fix CanvasTexture rendering when updating channels

This commit is contained in:
Stuart Carnie 2025-01-23 06:38:41 +11:00
parent b0655dc86f
commit 663917449b
4 changed files with 55 additions and 0 deletions

View file

@ -485,9 +485,14 @@ class RendererCanvasRenderRD : public RendererCanvasRender {
static void _before_evict(RendererCanvasRenderRD::RIDSetKey &p_key, RID &p_rid);
static void _uniform_set_invalidation_callback(void *p_userdata);
static void _canvas_texture_invalidation_callback(bool p_deleted, void *p_userdata);
typedef LRUCache<RIDSetKey, RID, HashableHasher<RIDSetKey>, HashMapComparatorDefault<RIDSetKey>, _before_evict> RIDCache;
RIDCache rid_set_to_uniform_set;
/// Maps a CanvasTexture to its associated uniform sets, which must
/// be invalidated when the CanvasTexture is updated, such as changing the
/// diffuse texture.
HashMap<RID, TightLocalVector<RID>> canvas_texture_to_uniform_set;
struct Batch {
// Position in the UBO measured in bytes