Refactor material palette system with GPU indirection

Major overhaul of material palette management:
- Added two-buffer indirection (PaletteOffsetBuffer, MaterialIndexBuffer) for GPU material lookup, with incremental upload and resizing.
- MaterialPaletteStore now tracks dirty ranges, supports deferred slot reclamation, and exposes CPU-side arrays for upload.
- ResourceManager manages persistent GPU buffers and uploads only dirty subranges per frame.
- Updated HLSL and C# structs to use palette indices.
- Refactored systems/components to use new palette index and release logic.
- Added RenderContext.UploadBufferRange for partial uploads.
Minor: Fixed StbIApi interop signatures, updated test namespaces, and performed code cleanups.
This commit is contained in:
2026-04-28 18:22:09 +09:00
parent 631638f3fb
commit 0eaf7cd51d
19 changed files with 390 additions and 30 deletions

View File

@@ -1,8 +1,11 @@
using Ghost.Core;
using Ghost.Entities;
using Ghost.Graphics.Services;
namespace Ghost.Engine.Components;
public struct GPUInstanceRef : IComponent
{
public uint gpuSceneIndex;
public uint gpuInstanceIndex;
public Identifier<MaterialPalette> materialPalette;
}