Hello Team,
On the Ganesh Metal backend (Skia m118, macOS), I need to render into many independent MTKView surfaces simultaneously.
All rendering happens on the main thread, and every view uses the same MTLDevice (and command queue).
I have a few questions about the recommended architecture:
1. Is it recommended to share a single GrDirectContext across multiple MTKView surfaces by creating one SkSurface per view, rather than creating a separate GrDirectContext for each view?
2. Is GrDirectContext::setResourceCacheLimit(...) the recommended way to cap GPU memory usage? If so, are there any guidelines for choosing the cache limit?
3. When a view is destroyed and its SkSurface is released, what is the recommended way to reclaim the associated GPU memory?
4. Are there any caveats to sharing a single GrDirectContext across multiple SkSurfaces on a single thread?
Regards,
BK