Skip to content

Cache API Thoughts #8

Closed
Closed
@mokafolio

Description

@mokafolio

In the OpenGL implementation Tarp does a lot of caching under the hood in order to minimize work. While that is good enough in most cases, @TilmannR pointed out that it could be useful to have the caching as part of the API for cases where you'd render the same path using different transformations/styles etc.. In the current version, you basically can only clone that path if you want to avoid that redrawing will invalidate the hidden cache. Here is a simple API suggestion, do you think this is good enough? Thoughts?

//this will use the current transform set on the context
tpRenderCache cache = tpCachePath(ctx, path, &style);
//this will draw the cached path data
tpDrawRenderCache(ctx, cache);
//destroy the cache
tpRenderCacheDestroy(cache);

While I think that the render cache will most likely be a struct, holding cached geometry data, exposing it to the API through a handle will allow it to potentially store GPU primitives and it just seems to be the more future proof API vs just having a struct. Any opinions on that?

Please also check out the Vulkan thoughts over here as both topics are closely related:
#7

Any thoughts welcome!

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions