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
-
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;
GRC1
andGRC2
:S1
usingGRC1
.S1
.S1
and save it onS1Img
.S2
usingGRC2
.S1Img
intoS2
.This code is a bit diffrent where
GRC2
andS2
are created internaly inside ofSKGLElement
:After modifing
SkiaSharp.Views.WPF.SKGLElement
class to use the latestGLWpfControl
from OpenTK, we usedSharedContext
onGLWpfControlSettings
to share resources between diffrent GLContexts.The issue is that the sharing is happening on
GLContext
notGRContext
.The result of drawing
S1Img
intoS2
that 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