Files
GhostEngine/src/ThridParty/Ghost.DXC/Api.cs
Misaki 8d3e1c91d7 Add sub-asset import and mesh asset support
- Implement sub-asset import for mesh/model assets with manifest generation and deterministic GUIDs
- Extend AssetCatalog for sub-asset tracking and management
- Update AssetRegistry and ImportCoordinator for sub-asset workflows
- Add mesh asset parsing, GPU upload, and resource management
- Update mesh data structures for meshlet groups/hierarchy and LODs
- Improve tests for sub-asset import and mesh handling
- Enhance mocks for mesh asset testing and resource mapping
- Fix path handling and native DLL loading issues
- Miscellaneous bug fixes and refactoring
2026-05-04 21:25:03 +09:00

29 lines
840 B
C#

using System.Reflection;
using System.Runtime.InteropServices;
namespace Ghost.DXC;
public partial class Api
{
static Api()
{
NativeLibrary.SetDllImportResolver(typeof(Api).Assembly, DxcDllImportResolver);
}
private static nint DxcDllImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
{
// NOTE: Currently only support Windows.
if (libraryName == "dxcompiler")
{
NativeLibrary.TryLoad(Path.Combine(AppContext.BaseDirectory, "runtimes", "win-x64", "native", "dxil.dll"), out _);
if (NativeLibrary.TryLoad(Path.Combine(AppContext.BaseDirectory, "runtimes", "win-x64", "native", "dxcompiler.dll"), out var dxcHandle))
{
return dxcHandle;
}
}
return IntPtr.Zero;
}
}