Skip to content

SparkGL: Cache srcTexture across encode calls. - #49

Merged
castano merged 4 commits into
mainfrom
cache-src-texture
Aug 24, 2026
Merged

SparkGL: Cache srcTexture across encode calls.#49
castano merged 4 commits into
mainfrom
cache-src-texture

Conversation

@castano

@castano castano commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

When cacheTempResources is true SparkGL now also caches and reuses srcTexture. This matches the behavior of the WebGPU backend. The caching heuristic is very simple: if the new texture doesn't fit within the cached texture, then it allocates a new one.

We may want to improve this in the future, for example, by ensuring the cached texture is large enough to hold all the textures seen so far, or by ensuring all the dimensions are greater or equal than a minimum cache size.

Added a bunch of tests generated by Claude.

This partially addresses the issues brought up in #46

@castano
castano merged commit 66fcf2f into main Aug 24, 2026
@castano
castano deleted the cache-src-texture branch August 24, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant