mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
7 changed files with 768360 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
|||
using Brutal.Interop;
|
||||
using Brutal.Numerics;
|
||||
using Brutal.Pointers;
|
||||
|
||||
namespace Brutal.MeshOptimizer
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
public unsafe partial struct MeshOptBounds
|
||||
{
|
||||
/// bounding sphere, useful for frustum and occlusion culling
|
||||
[FieldOffset(0)]
|
||||
public float3 Center;
|
||||
|
||||
[FieldOffset(12)]
|
||||
public float Radius;
|
||||
|
||||
/// normal cone, useful for backface culling
|
||||
[FieldOffset(16)]
|
||||
public float3 ConeApex;
|
||||
|
||||
[FieldOffset(28)]
|
||||
public float3 ConeAxis;
|
||||
|
||||
/// = cos(angle/2)
|
||||
[FieldOffset(40)]
|
||||
public float ConeCutoff;
|
||||
|
||||
/// normal cone axis and cutoff, stored in 8-bit SNORM format; decode using x/127.0
|
||||
[FieldOffset(44)]
|
||||
public byte3 ConeAxisS8;
|
||||
|
||||
[FieldOffset(47)]
|
||||
public byte ConeCutoffS8;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using Brutal.Interop;
|
||||
using Brutal.Numerics;
|
||||
using Brutal.Pointers;
|
||||
|
||||
namespace Brutal.MeshOptimizer
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
public unsafe partial struct MeshOptCoverageStatistics
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public float3 Coverage;
|
||||
|
||||
/// viewport size in mesh coordinates
|
||||
[FieldOffset(12)]
|
||||
public float Extent;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using Brutal.Interop;
|
||||
using Brutal.Numerics;
|
||||
using Brutal.Pointers;
|
||||
|
||||
namespace Brutal.MeshOptimizer
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
public unsafe partial struct MeshOptMeshlet
|
||||
{
|
||||
/// offsets within meshlet_vertices and meshlet_triangles arrays with meshlet data
|
||||
[FieldOffset(0)]
|
||||
public int VertexOffset;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public int TriangleOffset;
|
||||
|
||||
/// number of vertices and triangles used in the meshlet; data is stored in consecutive range [offset..offset+count) for vertices and [offset..offset+count*3) for triangles
|
||||
[FieldOffset(8)]
|
||||
public int VertexCount;
|
||||
|
||||
[FieldOffset(12)]
|
||||
public int TriangleCount;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using Brutal.Interop;
|
||||
using Brutal.Numerics;
|
||||
using Brutal.Pointers;
|
||||
|
||||
namespace Brutal.MeshOptimizer
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
public unsafe partial struct MeshOptOverdrawStatistics
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public int PixelsCovered;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public int PixelsShaded;
|
||||
|
||||
/// shaded pixels / covered pixels; best case 1.0
|
||||
[FieldOffset(8)]
|
||||
public float Overdraw;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using Brutal.Interop;
|
||||
using Brutal.Numerics;
|
||||
using Brutal.Pointers;
|
||||
|
||||
namespace Brutal.MeshOptimizer
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
public unsafe partial struct MeshOptStream
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public Ptr Data;
|
||||
|
||||
[FieldOffset(8)]
|
||||
public ByteSize64 Size;
|
||||
|
||||
[FieldOffset(16)]
|
||||
public ByteSize64 Stride;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using Brutal.Interop;
|
||||
using Brutal.Numerics;
|
||||
using Brutal.Pointers;
|
||||
|
||||
namespace Brutal.MeshOptimizer
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
public unsafe partial struct MeshOptVertexCacheStatistics
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public int VerticesTransformed;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public int WarpsExecuted;
|
||||
|
||||
/// transformed vertices / triangle count; best case 0.5, worst case 3.0, optimum depends on topology
|
||||
[FieldOffset(8)]
|
||||
public float Acmr;
|
||||
|
||||
/// transformed vertices / vertex count; best case 1.0, worst case 6.0, optimum is 1.0 (each vertex is transformed once)
|
||||
[FieldOffset(12)]
|
||||
public float Atvr;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using Brutal.Interop;
|
||||
using Brutal.Numerics;
|
||||
using Brutal.Pointers;
|
||||
|
||||
namespace Brutal.MeshOptimizer
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
public unsafe partial struct MeshOptVertexFetchStatistics
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public int BytesFetched;
|
||||
|
||||
/// fetched bytes / vertex buffer size; best case 1.0 (each byte is fetched once)
|
||||
[FieldOffset(4)]
|
||||
public float Overfetch;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue