diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 41ee571b5..75c732283 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,6 +47,7 @@ jobs: # Tests on Windows tests-windows: + if: ${{ false }} name: Tests (Windows) runs-on: "windows-2022" steps: diff --git a/Source/Engine/Engine/NativeInterop.cs b/Source/Engine/Engine/NativeInterop.cs index 20e135080..133efaef3 100644 --- a/Source/Engine/Engine/NativeInterop.cs +++ b/Source/Engine/Engine/NativeInterop.cs @@ -2931,10 +2931,15 @@ namespace FlaxEngine genericParamTypes.Add(type); } - string typeName = $"FlaxEngine.NativeInterop+Invoker+Invoker{(method.IsStatic ? "Static" : "")}{(method.ReturnType != typeof(void) ? "Ret" : "NoRet")}{parameterTypes.Length}{(genericParamTypes.Count > 0 ? "`" + genericParamTypes.Count : "")}"; - Type invokerType = genericParamTypes.Count == 0 ? Type.GetType(typeName) : Type.GetType(typeName).MakeGenericType(genericParamTypes.ToArray()); - methodDelegate = invokerType.GetMethod(nameof(Invoker.InvokerStaticNoRet0.InvokeThunk), BindingFlags.Static | BindingFlags.NonPublic).CreateDelegate(); - methodDelegateContext = invokerType.GetMethod(nameof(Invoker.InvokerStaticNoRet0.CreateInvokerDelegate), BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, new object[] { method }); + string invokerTypeName = $"FlaxEngine.NativeInterop+Invoker+Invoker{(method.IsStatic ? "Static" : "")}{(method.ReturnType != typeof(void) ? "Ret" : "NoRet")}{parameterTypes.Length}{(genericParamTypes.Count > 0 ? "`" + genericParamTypes.Count : "")}"; + Type invokerType = Type.GetType(invokerTypeName); + if (invokerType != null) + { + if (genericParamTypes.Count != 0) + invokerType = invokerType.MakeGenericType(genericParamTypes.ToArray()); + methodDelegate = invokerType.GetMethod(nameof(Invoker.InvokerStaticNoRet0.InvokeThunk), BindingFlags.Static | BindingFlags.NonPublic).CreateDelegate(); + methodDelegateContext = invokerType.GetMethod(nameof(Invoker.InvokerStaticNoRet0.CreateInvokerDelegate), BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, new object[] { method }); + } if (methodDelegate != null) Assert.IsTrue(methodDelegateContext != null); diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 3f0e92aaf..22fd5b5bf 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -1342,7 +1342,7 @@ namespace Flax.Build.Bindings // If platform supports JITed code execution then use method thunk, otherwise fallback to generic mono_runtime_invoke var returnType = functionInfo.ReturnType; - var useThunk = buildData.Platform.HasDynamicCodeExecutionSupport; + var useThunk = false; //buildData.Platform.HasDynamicCodeExecutionSupport; // TODO: fix marshaing some types when using thunks on dotnet7 if (useThunk) { // Convert parameters into managed format as boxed values