How to Share Resources between diffrent GRContexts? #2972
Unanswered
AhmedEssoubai
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're trying to use multiple GRContexts for rendering on diffrent threads. But, we're struglling with sharing resources between them.
A simple example with 2 GRContexts;
GRC1andGRC2:S1usingGRC1.S1.S1and save it onS1Img.S2usingGRC2.S1ImgintoS2.This code is a bit diffrent where
GRC2andS2are created internaly inside ofSKGLElement:After modifing
SkiaSharp.Views.WPF.SKGLElementclass to use the latestGLWpfControlfrom OpenTK, we usedSharedContextonGLWpfControlSettingsto share resources between diffrent GLContexts.The issue is that the sharing is happening on
GLContextnotGRContext.The result of drawing
S1ImgintoS2that we get is nothing (just like drawing a transparent image). But, we do have a workaround by rasterising the image before drawing:But, this is slow, especially with large images. We wan't something that skips the rasterisation step. Is there away to share resources between GRContexts just like GLContext?
Beta Was this translation helpful? Give feedback.
All reactions