Added Ufbx
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public static unsafe partial class Api
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum EdgeFixup
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
/// <summary>Defines the annotation found in a native declaration.</summary>
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
/// <summary>Defines the type of a member as it was used in the native signature.</summary>
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = true)]
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttAlphaMode
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttBatchList
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttBoolean
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttCPUInputBuffer
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttChannelOrder
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttCompressionOptions
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttContainer
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttContext
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttCubeLayout
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttCubeSurface
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttEncodeFlags
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public unsafe partial struct NvttEncodeSettings
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttError
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttFormat
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttGPUInputBuffer
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttInputFormat
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttMipmapFilter
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttNormalTransform
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttOutputOptions
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttPixelType
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttQuality
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public unsafe partial struct NvttRefImage
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttResizeFilter
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttRoundMode
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttSeverity
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttSurface
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttSurfaceSet
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttTextureType
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public partial struct NvttTimingContext
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttToneMapper
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttValueType
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt.Native
|
||||
namespace Ghost.Nvtt
|
||||
{
|
||||
public enum NvttWrapMode
|
||||
{
|
||||
@@ -15,10 +15,6 @@
|
||||
<IsAotCompatible>True</IsAotCompatible>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Ghost.Nvtt.Native" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="runtimes\win-x64\native\nvtt.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper around an nvtt batch list — a list of (surface, face, mipmap,
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Controls how a surface is compressed - format, quality, pixel layout and
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper around the nvtt compression context — the central object that drives
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper around an nvtt cube-map surface (six faces, optional mip chain).
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Static helpers wrapping global nvtt functions (version, CUDA detection,
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Internal helpers for converting between managed and unmanaged types.
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Configures where compressed data is written and how it is formatted.
|
||||
@@ -26,10 +26,10 @@ public sealed unsafe class NvttOutputOptionsHandle : IDisposable
|
||||
private delegate void BeginImageDelegate(int size, int width, int height, int depth, int face, int mipLevel);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
private delegate Ghost.Nvtt.Native.NvttBoolean OutputDataDelegate(void* data, int size, Ghost.Nvtt.Native.NvttBoolean lastChunk);
|
||||
private delegate NvttBoolean OutputDataDelegate(void* data, int size, NvttBoolean lastChunk);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
private delegate void ErrorDelegate(Ghost.Nvtt.Native.NvttError error);
|
||||
private delegate void ErrorDelegate(NvttError error);
|
||||
|
||||
// Pinned delegate instances - must stay alive as long as native code may call them.
|
||||
private BeginImageDelegate? _beginImageDelegate;
|
||||
@@ -174,8 +174,7 @@ public sealed unsafe class NvttOutputOptionsHandle : IDisposable
|
||||
_outputDataDelegate = (data, size, lastChunk) =>
|
||||
{
|
||||
var ok = outputData?.Invoke((nint)data, size) ?? true;
|
||||
return ok ? Ghost.Nvtt.Native.NvttBoolean.NVTT_True
|
||||
: Ghost.Nvtt.Native.NvttBoolean.NVTT_False;
|
||||
return ok ? Ghost.Nvtt.NvttBoolean.NVTT_True : Ghost.Nvtt.NvttBoolean.NVTT_False;
|
||||
};
|
||||
|
||||
var beginPtr = Marshal.GetFunctionPointerForDelegate(_beginImageDelegate);
|
||||
@@ -184,7 +183,7 @@ public sealed unsafe class NvttOutputOptionsHandle : IDisposable
|
||||
Api.nvttSetOutputOptionsOutputHandler(
|
||||
_ptr,
|
||||
(delegate* unmanaged[Cdecl]<int, int, int, int, int, int, void>)beginPtr,
|
||||
(delegate* unmanaged[Cdecl]<void*, int, Ghost.Nvtt.Native.NvttBoolean>)outputPtr,
|
||||
(delegate* unmanaged[Cdecl]<void*, int, NvttBoolean>)outputPtr,
|
||||
IntPtr.Zero);
|
||||
}
|
||||
|
||||
@@ -196,7 +195,7 @@ public sealed unsafe class NvttOutputOptionsHandle : IDisposable
|
||||
var errorPtr = Marshal.GetFunctionPointerForDelegate(_errorDelegate);
|
||||
Api.nvttSetOutputOptionsErrorHandler(
|
||||
_ptr,
|
||||
(delegate* unmanaged[Cdecl]<Ghost.Nvtt.Native.NvttError, void>)errorPtr);
|
||||
(delegate* unmanaged[Cdecl]<NvttError, void>)errorPtr);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper around a single 2-D / 3-D / cube-face image surface used as input
|
||||
@@ -201,7 +201,7 @@ public sealed unsafe class NvttSurfaceHandle : IDisposable
|
||||
var utf8 = NvttInterop.ToUtf8(fileName, buf);
|
||||
fixed (byte* p = utf8)
|
||||
{
|
||||
Ghost.Nvtt.Native.NvttBoolean nvAlpha;
|
||||
NvttBoolean nvAlpha;
|
||||
var ok = NvttInterop.ToBool(
|
||||
Api.nvttSurfaceLoad(_ptr, (sbyte*)p, &nvAlpha,
|
||||
NvttInterop.ToNvtt(expectSigned), tc));
|
||||
@@ -217,7 +217,7 @@ public sealed unsafe class NvttSurfaceHandle : IDisposable
|
||||
ThrowIfDisposed();
|
||||
fixed (byte* p = data)
|
||||
{
|
||||
Ghost.Nvtt.Native.NvttBoolean nvAlpha;
|
||||
NvttBoolean nvAlpha;
|
||||
var ok = NvttInterop.ToBool(
|
||||
Api.nvttSurfaceLoadFromMemory(_ptr, p, (ulong)data.Length,
|
||||
&nvAlpha, NvttInterop.ToNvtt(expectSigned), tc));
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper around an nvtt surface set — a collection of faces and mip levels
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Nvtt;
|
||||
namespace Ghost.Nvtt.Warper;
|
||||
|
||||
/// <summary>
|
||||
/// Wraps an nvtt timing context that records per-operation wall-clock times.
|
||||
Reference in New Issue
Block a user