feat(render): per-frame render requests & thread safety

Refactor RenderSystem to store render requests per-frame within FrameResource, improving encapsulation and resource management. Update render loop and AddRenderRequest to use the new structure, ensuring proper disposal and clearing of requests to prevent memory leaks. Remove the old global renderRequests array and update Dispose logic accordingly.

Add spin lock-based thread safety to D3D12ResourceDatabase for AddResource/AddAllocation, and introduce EnterParallelRead/ExitParallelRead methods for explicit locking.

Enhance RenderExtractionSystem and Material to support transparent render lists and a MaterialRenderType property, preparing for advanced rendering features. Includes minor code cleanups and comment improvements.
This commit is contained in:
2026-03-24 16:46:30 +09:00
parent d44ec0be31
commit 92e3d33361
8 changed files with 128 additions and 70 deletions

View File

@@ -1,3 +1,4 @@
#if flase
using Ghost.Core;
using Ghost.Graphics.Core;
using Ghost.Graphics.RenderGraphModule;
@@ -47,7 +48,7 @@ public partial class GhostRenderPipeline
private readonly uint _padding1;
private readonly uint _padding2;
}
#if flase
private void RenderTest(RenderGraph graph, Identifier<RGTexture> backbuffer)
{
Identifier<RGTexture> renderTarget;
@@ -107,5 +108,5 @@ public partial class GhostRenderPipeline
});
}
}
# endif
}
# endif