feat(bindings): update C# wrappers for meshopt, nvtt, ufbx

Refactor and regenerate native C# bindings for Ghost.MeshOptimizer, Ghost.Nvtt, and Ghost.Ufbx to match updated native APIs and improve usability.
- Replace meshoptimizer.dll with newer version.
- Move meshoptimizer functions to static methods in partial class; add new meshlet, simplification, quantization features.
- Remove enum wrappers in favor of constants; delete meshopt_Allocator.cs.
- Regenerate native wrappers with PascalCase naming, XML doc comments, and aggressive inlining.
- Implement IDisposable for resource structs; update configs for naming, documentation, and method mapping.
- Update user code to use new wrapper classes and method names.
- Improve documentation and comments for clarity.

BREAKING CHANGE: API surface changes, wrapper class and method names updated, enum wrappers removed, custom allocator deleted.
This commit is contained in:
2026-03-17 00:19:54 +09:00
parent 9bae3e647e
commit e831b71a79
62 changed files with 3820 additions and 1285 deletions

View File

@@ -2,14 +2,15 @@
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
// </auto-generated>
using System.Runtime.CompilerServices;
namespace Ghost.Ufbx;
public unsafe partial struct ufbx_props
{
// From: ufbx_find_prop_len(ufbx_props*, sbyte*, nuint)
public ufbx_prop* find_prop_len(ReadOnlySpan<byte> name)
/// <summary>
/// From: <see cref="Api.ufbx_find_prop_len(ufbx_props*, sbyte*, nuint)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_prop* FindPropLen(ReadOnlySpan<byte> name)
{
fixed (byte* pname = name)
{
@@ -20,16 +21,22 @@ public unsafe partial struct ufbx_props
}
}
// From: ufbx_find_prop(ufbx_props*, sbyte*)
public ufbx_prop* find_prop(sbyte* name)
/// <summary>
/// From: <see cref="Api.ufbx_find_prop(ufbx_props*, sbyte*)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_prop* FindProp(sbyte* name)
{
return Api.ufbx_find_prop(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
name);
}
// From: ufbx_find_real_len(ufbx_props*, sbyte*, nuint, float)
public float find_real_len(ReadOnlySpan<byte> name, float def)
/// <summary>
/// From: <see cref="Api.ufbx_find_real_len(ufbx_props*, sbyte*, nuint, float)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public float FindRealLen(ReadOnlySpan<byte> name, float def)
{
fixed (byte* pname = name)
{
@@ -41,8 +48,11 @@ public unsafe partial struct ufbx_props
}
}
// From: ufbx_find_real(ufbx_props*, sbyte*, float)
public float find_real(sbyte* name, float def)
/// <summary>
/// From: <see cref="Api.ufbx_find_real(ufbx_props*, sbyte*, float)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public float FindReal(sbyte* name, float def)
{
return Api.ufbx_find_real(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
@@ -50,8 +60,11 @@ public unsafe partial struct ufbx_props
def);
}
// From: ufbx_find_vec3_len(ufbx_props*, sbyte*, nuint, Misaki.HighPerformance.Mathematics.float3)
public Misaki.HighPerformance.Mathematics.float3 find_vec3_len(ReadOnlySpan<byte> name, Misaki.HighPerformance.Mathematics.float3 def)
/// <summary>
/// From: <see cref="Api.ufbx_find_vec3_len(ufbx_props*, sbyte*, nuint, Misaki.HighPerformance.Mathematics.float3)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public Misaki.HighPerformance.Mathematics.float3 FindVec3Len(ReadOnlySpan<byte> name, Misaki.HighPerformance.Mathematics.float3 def)
{
fixed (byte* pname = name)
{
@@ -63,8 +76,11 @@ public unsafe partial struct ufbx_props
}
}
// From: ufbx_find_vec3(ufbx_props*, sbyte*, Misaki.HighPerformance.Mathematics.float3)
public Misaki.HighPerformance.Mathematics.float3 find_vec3(sbyte* name, Misaki.HighPerformance.Mathematics.float3 def)
/// <summary>
/// From: <see cref="Api.ufbx_find_vec3(ufbx_props*, sbyte*, Misaki.HighPerformance.Mathematics.float3)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public Misaki.HighPerformance.Mathematics.float3 FindVec3(sbyte* name, Misaki.HighPerformance.Mathematics.float3 def)
{
return Api.ufbx_find_vec3(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
@@ -72,8 +88,11 @@ public unsafe partial struct ufbx_props
def);
}
// From: ufbx_find_int_len(ufbx_props*, sbyte*, nuint, long)
public long find_int_len(ReadOnlySpan<byte> name, long def)
/// <summary>
/// From: <see cref="Api.ufbx_find_int_len(ufbx_props*, sbyte*, nuint, long)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public long FindIntLen(ReadOnlySpan<byte> name, long def)
{
fixed (byte* pname = name)
{
@@ -85,8 +104,11 @@ public unsafe partial struct ufbx_props
}
}
// From: ufbx_find_int(ufbx_props*, sbyte*, long)
public long find_int(sbyte* name, long def)
/// <summary>
/// From: <see cref="Api.ufbx_find_int(ufbx_props*, sbyte*, long)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public long FindInt(sbyte* name, long def)
{
return Api.ufbx_find_int(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
@@ -94,8 +116,11 @@ public unsafe partial struct ufbx_props
def);
}
// From: ufbx_find_bool_len(ufbx_props*, sbyte*, nuint, bool)
public bool find_bool_len(ReadOnlySpan<byte> name, bool def)
/// <summary>
/// From: <see cref="Api.ufbx_find_bool_len(ufbx_props*, sbyte*, nuint, bool)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public bool FindBoolLen(ReadOnlySpan<byte> name, bool def)
{
fixed (byte* pname = name)
{
@@ -107,8 +132,11 @@ public unsafe partial struct ufbx_props
}
}
// From: ufbx_find_bool(ufbx_props*, sbyte*, bool)
public bool find_bool(sbyte* name, bool def)
/// <summary>
/// From: <see cref="Api.ufbx_find_bool(ufbx_props*, sbyte*, bool)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public bool FindBool(sbyte* name, bool def)
{
return Api.ufbx_find_bool(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
@@ -116,8 +144,11 @@ public unsafe partial struct ufbx_props
def);
}
// From: ufbx_find_string_len(ufbx_props*, sbyte*, nuint, ufbx_string)
public ufbx_string find_string_len(ReadOnlySpan<byte> name, ufbx_string def)
/// <summary>
/// From: <see cref="Api.ufbx_find_string_len(ufbx_props*, sbyte*, nuint, ufbx_string)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_string FindStringLen(ReadOnlySpan<byte> name, ufbx_string def)
{
fixed (byte* pname = name)
{
@@ -129,8 +160,11 @@ public unsafe partial struct ufbx_props
}
}
// From: ufbx_find_string(ufbx_props*, sbyte*, ufbx_string)
public ufbx_string find_string(sbyte* name, ufbx_string def)
/// <summary>
/// From: <see cref="Api.ufbx_find_string(ufbx_props*, sbyte*, ufbx_string)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_string FindString(sbyte* name, ufbx_string def)
{
return Api.ufbx_find_string(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
@@ -138,8 +172,11 @@ public unsafe partial struct ufbx_props
def);
}
// From: ufbx_find_blob_len(ufbx_props*, sbyte*, nuint, ufbx_blob)
public ufbx_blob find_blob_len(ReadOnlySpan<byte> name, ufbx_blob def)
/// <summary>
/// From: <see cref="Api.ufbx_find_blob_len(ufbx_props*, sbyte*, nuint, ufbx_blob)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_blob FindBlobLen(ReadOnlySpan<byte> name, ufbx_blob def)
{
fixed (byte* pname = name)
{
@@ -151,8 +188,11 @@ public unsafe partial struct ufbx_props
}
}
// From: ufbx_find_blob(ufbx_props*, sbyte*, ufbx_blob)
public ufbx_blob find_blob(sbyte* name, ufbx_blob def)
/// <summary>
/// From: <see cref="Api.ufbx_find_blob(ufbx_props*, sbyte*, ufbx_blob)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_blob FindBlob(sbyte* name, ufbx_blob def)
{
return Api.ufbx_find_blob(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
@@ -160,8 +200,11 @@ public unsafe partial struct ufbx_props
def);
}
// From: ufbx_find_prop_concat(ufbx_props*, ufbx_string*, nuint)
public ufbx_prop* find_prop_concat(ufbx_string* parts, nuint num_parts)
/// <summary>
/// From: <see cref="Api.ufbx_find_prop_concat(ufbx_props*, ufbx_string*, nuint)" />
/// </summary>
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_prop* FindPropConcat(ufbx_string* parts, nuint num_parts)
{
return Api.ufbx_find_prop_concat(
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),