feat(nativegen)!: refactor to struct-based native wrappers
Major overhaul of native wrapper generation for ufbx and nvtt. Replaces all hand-written and class-based wrappers with auto-generated partial struct wrappers that directly expose native API methods via pointers. Introduces a new JSON-driven configuration system using "remaps" and "actions" for flexible parameter/return mapping and method routing. Removes legacy config sections and helper classes, focusing solely on method wrappers. Updates all usages and tests to use the new pointer-based API. Cleans up obsolete code and ensures resource management is handled via struct Dispose methods. The result is a thinner, more direct, and maintainable interop layer. BREAKING CHANGE: All managed wrapper classes and helpers are removed in favor of struct-based pointer wrappers. API usage and resource management patterns have changed.
This commit is contained in:
73
src/ThridParty/Ghost.Ufbx/Wrapper/ufbx_mesh.nativegen.cs
Normal file
73
src/ThridParty/Ghost.Ufbx/Wrapper/ufbx_mesh.nativegen.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
// <auto-generated>
|
||||
// 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_mesh
|
||||
{
|
||||
// From: ufbx_find_face_index(ufbx_mesh*, nuint)
|
||||
public uint find_face_index(nuint index)
|
||||
{
|
||||
return Api.ufbx_find_face_index(
|
||||
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
index);
|
||||
}
|
||||
|
||||
// From: ufbx_compute_topology(ufbx_mesh*, ufbx_topo_edge*, nuint)
|
||||
public void compute_topology(ufbx_topo_edge* topo, nuint num_topo)
|
||||
{
|
||||
Api.ufbx_compute_topology(
|
||||
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
topo,
|
||||
num_topo);
|
||||
}
|
||||
|
||||
// From: ufbx_generate_normal_mapping(ufbx_mesh*, ufbx_topo_edge*, nuint, uint*, nuint, bool)
|
||||
public nuint generate_normal_mapping(ufbx_topo_edge* topo, nuint num_topo, uint* normal_indices, nuint num_normal_indices, bool assume_smooth)
|
||||
{
|
||||
return Api.ufbx_generate_normal_mapping(
|
||||
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
topo,
|
||||
num_topo,
|
||||
normal_indices,
|
||||
num_normal_indices,
|
||||
assume_smooth);
|
||||
}
|
||||
|
||||
// From: ufbx_compute_normals(ufbx_mesh*, ufbx_vertex_vec3*, uint*, nuint, Misaki.HighPerformance.Mathematics.float3*, nuint)
|
||||
public void compute_normals(ufbx_vertex_vec3* positions, uint* normal_indices, nuint num_normal_indices, Misaki.HighPerformance.Mathematics.float3* normals, nuint num_normals)
|
||||
{
|
||||
Api.ufbx_compute_normals(
|
||||
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
positions,
|
||||
normal_indices,
|
||||
num_normal_indices,
|
||||
normals,
|
||||
num_normals);
|
||||
}
|
||||
|
||||
// From: ufbx_subdivide_mesh(ufbx_mesh*, nuint, ufbx_subdivide_opts*, ufbx_error*)
|
||||
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);
|
||||
}
|
||||
|
||||
// From: ufbx_free_mesh(ufbx_mesh*)
|
||||
public void free()
|
||||
{
|
||||
Api.ufbx_free_mesh((ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
// From: ufbx_retain_mesh(ufbx_mesh*)
|
||||
public void retain()
|
||||
{
|
||||
Api.ufbx_retain_mesh((ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user