SkiaSharp : How to change shader matrix without create new shader every frame ? #3521
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
GC pressure generally applies to managed allocations. It doesn't know about unmanaged memory unless you tell it with Here, what you might want to do is to restructure the rendering to apply the transform to the canvas rather than the shader - |
Beta Was this translation helpful? Give feedback.

GC pressure generally applies to managed allocations. It doesn't know about unmanaged memory unless you tell it with
GC.AddMemoryPressure, and SkiaSharp doesn't call that. It would be hard to even estimate a value for a lot of objects, and even if you did, the memory might also reside largely on the GPU. So, you might well run out of resources before the GC even thinks to kick in. Basically, in general, if you're not deterministically disposing stuff with SkiaSharp then you're going to have a bad time.Here, what you might want to do is to restructure the rendering to apply the transform to the canvas rather than the shader -
SKAutoCanvasRestoremight help you out.