In the Gray Book, it says to use SharpDX.Mathetmatics
types to have compatibility with VVVV Vectors and Matrices.
If I use SharpDX.Vector4, VL seems to read them fine, but I constant annoying errors like this:
If I use SharpDX.Mathematics.RawVector types, I seem to get the same errors. What’s up with this?
My code is extremely simple, just structs such as:
public enum LightType
{
Point,
Spot,
Directional
}
[StructLayout(LayoutKind.Sequential)]
public struct Light
{
public LightType LightType;
public Color4 Colour;
public float Intensity;
public Matrix Transform;
public Vector4 Params;
public Light(LightType lightType, Color4 colour, float intensity, Matrix transform, Vector4 lightParams)
{
LightType = lightType;
Colour = colour;
Intensity = intensity;
Transform = transform;
Params = lightParams;
}
}
Here’s the full, unhelpful stack trace:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Cci.ReflectionEmitter.DynamicLoader.Emitter.EmitIL(ILGenerator ilGenerator, IMethodBody methodBody) in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Microsoft.Cci\src\Microsoft.Cci.ReflectionEmitter\Emitter.cs:line 1320
at Microsoft.Cci.ReflectionEmitter.DynamicLoader.Emitter.Visit(IMethodDefinition method) in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Microsoft.Cci\src\Microsoft.Cci.ReflectionEmitter\Emitter.cs:line 991
at Microsoft.Cci.MetadataTraverser.Traverse(IMethodDefinition method)
at Microsoft.Cci.MetadataTraverser.Traverse(IEnumerable`1 methods)
at Microsoft.Cci.MetadataTraverser.TraverseChildren(ITypeDefinition typeDefinition)
at Microsoft.Cci.MetadataTraverser.Traverse(INamespaceTypeDefinition namespaceTypeDefinition)
at Microsoft.Cci.MetadataTraverser.Traverse(IEnumerable`1 types)
at Microsoft.Cci.ReflectionEmitter.DynamicLoader.Load(IEnumerable`1 types) in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Microsoft.Cci\src\Microsoft.Cci.ReflectionEmitter\Emitter.cs:line 180
at VL.Lang.Platforms.CIL.CilCompilation.CreateDynamicLoader(CancellationToken token) in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Lang\src\Platforms\CIL\Lazy\Compilation.cs:line 547
at VL.Lang.Platforms.CIL.CilCompilation..ctor(Platform platform, PreCompilation compilation, CompilationOptions options, CancellationToken token, ImmutableHashSet`1 entryPointIds, CilCompilation previous, String exportDir) in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Lang\src\Platforms\CIL\Lazy\Compilation.cs:line 103
at VL.Lang.Platforms.CIL.CilCompilation.WithCompilation(PreCompilation compilation, ImmutableHashSet`1 entryPointIds, CancellationToken token) in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Lang\src\Platforms\CIL\Lazy\Compilation.cs:line 621
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at VL.Lang.Platforms.CIL.Platform.<UpdateAsync>d__30.MoveNext() in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Lang\src\Platforms\CIL\Platform.cs:line 176
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at VL.Lang.Platforms.CIL.Platform.<Session_CompilationUpdated>d__29.MoveNext() in C:\BuildAgent\work\95074898639d5736\vvvv50\VL.Lang\src\Platforms\CIL\Platform.cs:line 157
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
VVVV.Hosting
Assembly Version: 0.0.0.0
Win32 Version: 38.1.4003.0
CodeBase: file:///D:/dev/vvvv_50beta38.1_x64/lib/core/VVVV.Hosting.DLL
----------------------------------------
VVVV.PluginInterfaces
Assembly Version: 0.0.0.0
Win32 Version: 38.1.4003.0
CodeBase: file:///D:/dev/vvvv_50beta38.1_x64/lib/core/VVVV.PluginInterfaces.DLL
----------------------------------------
VVVV.Core
Assembly Version: 0.0.0.0
Win32 Version: 38.1.4003.0
CodeBase: file:///D:/dev/vvvv_50beta38.1_x64/lib/core/VVVV.Core.DLL
----------------------------------------
System.Drawing