This might be something very stupid and it might be a longshot... but maybe someone here can help.
I'm attempting to convert one of my CustomEffects that I've written in C# to C++. I'll start out by saying that the effect works just fine in C#, just a little slow but I'm hoping to speed it up.
I've followed SB Dev's excellent wiki article on this and I've pretty much copied his template code for implementing the effect in C++. I'm not going to post it unless there's no choice (it's fairly large).
However, to implement the effect in my managed code, all I did was switch one line.... from using the C# effect to the C++ effect like so:
(FYI, I know I named my C# managed class incorrectly)
//this is the c++ effect
using (var edgeEffect = new DelegatingEffect(preFilterEffect, new CustomEffects.FindEdgesEffect((float)LowThresholdDetection, (float)HighThresholdDetection, 2f, 16, false, true)))
//this is the c# effect
//using (var edgeEffect = new EdgeDetectionFilter(preFilterEffect, (float)LowThresholdDetection, (float)HighThresholdDetection, 2f, 16, false,
With the C# version, the effect works fine. When I comment it out and replace it with the C++ effect, I get a NullReferenceException. I can't figure out where this is coming from. The effect initialization goes ok. I can step through it using native debugging and see that each variable gets put in the right place. The exception is being thrown when the RenderAsync is called. Putting a breakpoint at the beginning of the effect's Process method does nothing.
Does anyone have any idea what I might be doing wrong?