Refactor rendering projects
This commit is contained in:
@@ -32,13 +32,22 @@ public partial class UnitTestApp : Application
|
||||
OperatingSystem.IsMacOS() ? "osx" : "unknown";
|
||||
var arch = Environment.Is64BitProcess ? "x64" : "x86";
|
||||
var nativeDllDir = Path.Combine(currentDir, "runtimes", platform + "-" + arch, "native");
|
||||
if (Directory.Exists(nativeDllDir))
|
||||
//if (Directory.Exists(nativeDllDir))
|
||||
//{
|
||||
// foreach (var dll in Directory.EnumerateFiles(nativeDllDir, "*.dll"))
|
||||
// {
|
||||
// NativeLibrary.Load(dll);
|
||||
// }
|
||||
//}
|
||||
NativeLibrary.SetDllImportResolver(typeof(UnitTestApp).Assembly, (libraryName, assembly, searchPath) =>
|
||||
{
|
||||
foreach (var dll in Directory.EnumerateFiles(nativeDllDir, "*.dll"))
|
||||
if (libraryName == "dxcompiler")
|
||||
{
|
||||
NativeLibrary.Load(dll);
|
||||
NativeLibrary.Load(Path.Combine(nativeDllDir, "dxil.dll"));
|
||||
}
|
||||
}
|
||||
|
||||
return IntPtr.Zero;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<PublishAot>True</PublishAot>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user