Replies: 1 comment 4 replies
-
There where other people having this issue, if you setup a repo example I can try to fix it. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use a pixel shader effect with Vortice's Direct2D. The only thing I got so far is an exception I have troubles to understand.
What I do
Draw some text in an offscreen
ID2D1BitmapRenderTarget
:Apply the shader and draw the result on screen:
The shader effect is initialized as such:
What I get
The application runs fine for a few moments (top ~ 1 min), then the call to
g.EndDraw()
— which happens afterg.DrawImage()
— throws. It throws without returning an error code, i.e. it doesn't even get to the point of calling.CheckError()
on theResult
that was returned byg.EndDraw()
. Nothing indicates that the device was reset or lost.Using the shader happens inside an
if
branch. The application runs fine forever if the conditional doesn't take the "shader" path, then might crash immediately upon entering the path.It seems
TextHightlightShader.Implementation.DisposeCore(false)
is called by the Garbage Collector. To prevent GC from happening, I should keep a reference to theImplementation
object, but I don't instantiate it, so I don't see any way for me to do so...The shader effect code
The HLSL shader itself doesn't do much yet:
Beta Was this translation helpful? Give feedback.
All reactions