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:
@@ -47,6 +47,10 @@ public interface IResourceDatabase : IDisposable
|
||||
where T : unmanaged;
|
||||
*/
|
||||
|
||||
void EnterParallelRead();
|
||||
|
||||
void ExitParallelRead();
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a resource with the specified handle exists in the database.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user