feat(graphics): refactor pipeline keying and allocators

Major refactor of graphics pipeline keying, shader cache, and resource allocation.
Replaced most Allocator usage with AllocationHandle, modernized logger usage,
and unified pipeline state keys. Updated MeshUtility to use AllocationHandle.FreeList.
Added new shader pipeline architecture docs and improved error handling throughout.

BREAKING CHANGE: Pipeline keying and resource allocation APIs have changed.
This commit is contained in:
2026-04-13 23:07:52 +09:00
parent c66fda5332
commit 817b32b8d9
69 changed files with 1436 additions and 2095 deletions

View File

@@ -139,7 +139,7 @@ public unsafe partial class TestRenderPipeline : IRenderPipeline
continue;
}
var rtSize = new uint2(rtResult.Value.TextureDescription.Width, rtResult.Value.TextureDescription.Height);
var rtSize = new uint2(rtResult.Value.TextureDescriptor.Width, rtResult.Value.TextureDescriptor.Height);
var aspectScreen = (float)rtSize.x / rtSize.y;

View File

@@ -52,9 +52,9 @@ public class RenderExtractionSystem : ISystem
ref readonly var camLtwRef = ref camLtw.Get();
// TODO: Classify transparent objects into a separate render list and render via oit.
var renderList = new RenderList(1, 64, Allocator.FreeList);
var transparentRenderList = new RenderList(1, 64, Allocator.FreeList);
var shadowCasterRenderList = new RenderList(1, 64, Allocator.FreeList);
var renderList = new RenderList(1, 64, AllocationHandle.FreeList);
var transparentRenderList = new RenderList(1, 64, AllocationHandle.FreeList);
var shadowCasterRenderList = new RenderList(1, 64, AllocationHandle.FreeList);
// TODO: This chould be done in earallel jobs.
foreach (var chunk in meshQuery.GetChunkIterator())

View File

@@ -36,11 +36,11 @@ public partial class UnitTestApp : Application
UnhandledException += (sender, e) =>
{
Logger.LogError(e.Exception);
Logger.Error(e.Exception);
#if DEBUG
System.Diagnostics.Debugger.Break();
#endif
Environment.FailFast("Unhandled exception", e.Exception);
};
}
}
}

View File

@@ -50,7 +50,7 @@ internal static class MeshUtility
space_conversion = ufbx_space_conversion.UFBX_SPACE_CONVERSION_MODIFY_GEOMETRY,
};
using var str = new UnsafeArray<byte>(Encoding.UTF8.GetByteCount(filePath) + 1, Allocator.FreeList);
using var str = new UnsafeArray<byte>(Encoding.UTF8.GetByteCount(filePath) + 1, AllocationHandle.FreeList);
var count = Encoding.UTF8.GetBytes(filePath, str.AsSpan());
str[count] = 0;
@@ -60,7 +60,7 @@ internal static class MeshUtility
return Result.Failure(error.description.ToString());
}
using var flatVertices = new UnsafeList<Vertex>(1024, Allocator.FreeList);
using var flatVertices = new UnsafeList<Vertex>(1024, AllocationHandle.FreeList);
var needComputeNormals = false;
@@ -83,7 +83,7 @@ internal static class MeshUtility
var maxScratchIndices = (int)(pMesh->max_face_triangles * 3u);
using var triIndicesArray = new UnsafeArray<uint>(maxScratchIndices, Allocator.FreeList);
using var triIndicesArray = new UnsafeArray<uint>(maxScratchIndices, AllocationHandle.FreeList);
for (var j = 0u; j < pMesh->num_faces; j++)
{
@@ -142,8 +142,8 @@ internal static class MeshUtility
var numIndices = (uint)flatVertices.Count;
using var weldedIndices = new UnsafeArray<uint>((int)numIndices, Allocator.FreeList);
using var cachedIndices = new UnsafeArray<uint>((int)numIndices, Allocator.FreeList);
using var weldedIndices = new UnsafeArray<uint>((int)numIndices, AllocationHandle.FreeList);
using var cachedIndices = new UnsafeArray<uint>((int)numIndices, AllocationHandle.FreeList);
var stream = new ufbx_vertex_stream
{