Refactored native wrappers to use ReadOnlySpan<T> for pointer parameters, improving .NET safety and interop. Enhanced wrapper generator with $TYPE and prefix/suffix-based parameter remapping. Added platform-specific native library loading for meshoptimizer, nvtt, and ufbx. Updated D3D12GraphicsEngineFactory for native DLL resolution and removed redundant logic from UnitTestApp. Changed RenderGraphBuilder's resource extraction API to use QueryTextureExtraction/QueryBufferExtraction with explicit handles and flags. Removed IRenderer and D3D12Renderer, moving RenderContext to RenderPipeline. Improved mesh loading, resource management, and updated test shader conventions. Updated project references, build settings, and added launchSettings.json for tooling. BREAKING CHANGE: Native wrapper APIs now use ReadOnlySpan<T> instead of pointers. RenderGraphBuilder resource extraction API has changed. IRenderer and D3D12Renderer have been removed.
108 lines
4.4 KiB
C#
108 lines
4.4 KiB
C#
// <auto-generated>
|
|
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
|
|
// </auto-generated>
|
|
|
|
namespace Ghost.Ufbx;
|
|
|
|
public unsafe partial struct ufbx_mesh : System.IDisposable
|
|
{
|
|
/// <summary>
|
|
/// From: <see cref="Api.ufbx_find_face_index(ufbx_mesh*, nuint)" />
|
|
/// </summary>
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
|
public uint FindFaceIndex(nuint index)
|
|
{
|
|
return Api.ufbx_find_face_index(
|
|
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
index);
|
|
}
|
|
|
|
/// <summary>
|
|
/// From: <see cref="Api.ufbx_compute_topology(ufbx_mesh*, ufbx_topo_edge*, nuint)" />
|
|
/// </summary>
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
|
public void ComputeTopology(ReadOnlySpan<ufbx_topo_edge> topo)
|
|
{
|
|
fixed (ufbx_topo_edge* ptopo = topo)
|
|
{
|
|
Api.ufbx_compute_topology(
|
|
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
(ufbx_topo_edge*)ptopo,
|
|
(nuint)topo.Length);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// From: <see cref="Api.ufbx_generate_normal_mapping(ufbx_mesh*, ufbx_topo_edge*, nuint, uint*, nuint, bool)" />
|
|
/// </summary>
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
|
public nuint GenerateNormalMapping(ReadOnlySpan<ufbx_topo_edge> topo, ReadOnlySpan<uint> normal_indices, bool assume_smooth)
|
|
{
|
|
fixed (ufbx_topo_edge* ptopo = topo)
|
|
{
|
|
fixed (uint* pnormal_indices = normal_indices)
|
|
{
|
|
return Api.ufbx_generate_normal_mapping(
|
|
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
(ufbx_topo_edge*)ptopo,
|
|
(nuint)topo.Length,
|
|
(uint*)pnormal_indices,
|
|
(nuint)normal_indices.Length,
|
|
assume_smooth);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// From: <see cref="Api.ufbx_compute_normals(ufbx_mesh*, ufbx_vertex_vec3*, uint*, nuint, Misaki.HighPerformance.Mathematics.float3*, nuint)" />
|
|
/// </summary>
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
|
public void ComputeNormals(ufbx_vertex_vec3* positions, ReadOnlySpan<uint> normal_indices, ReadOnlySpan<Misaki.HighPerformance.Mathematics.float3> normals)
|
|
{
|
|
fixed (uint* pnormal_indices = normal_indices)
|
|
{
|
|
fixed (Misaki.HighPerformance.Mathematics.float3* pnormals = normals)
|
|
{
|
|
Api.ufbx_compute_normals(
|
|
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
positions,
|
|
(uint*)pnormal_indices,
|
|
(nuint)normal_indices.Length,
|
|
(Misaki.HighPerformance.Mathematics.float3*)pnormals,
|
|
(nuint)normals.Length);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// From: <see cref="Api.ufbx_subdivide_mesh(ufbx_mesh*, nuint, ufbx_subdivide_opts*, ufbx_error*)" />
|
|
/// </summary>
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
|
public ufbx_mesh* Subdivide(nuint level, ufbx_subdivide_opts* opts, ufbx_error* error)
|
|
{
|
|
return Api.ufbx_subdivide_mesh(
|
|
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
level,
|
|
opts,
|
|
error);
|
|
}
|
|
|
|
/// <summary>
|
|
/// From: <see cref="Api.ufbx_free_mesh(ufbx_mesh*)" />
|
|
/// </summary>
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
|
public void Dispose()
|
|
{
|
|
Api.ufbx_free_mesh((ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
/// <summary>
|
|
/// From: <see cref="Api.ufbx_retain_mesh(ufbx_mesh*)" />
|
|
/// </summary>
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
|
public void Retain()
|
|
{
|
|
Api.ufbx_retain_mesh((ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
}
|