feat(rendergraph): async queue, pool refactor, barrier cleanup

Refactor resource pool to use UnsafeQueue/UnsafeList for transient resources, improving memory management and performance.
Add async GPU wait support to ICommandQueue and D3D12.
Refactor render graph barrier system, streamline CompiledBarrier, and remove ResourceBarrier.
RenderGraphCompiler now returns Result<float2, Error> for dynamic resolution scaling.
Replace custom memory pools with Allocator.FreeList for temp allocations.
Add ResourceUploadBatch for async/sync resource uploads.
Fix D3D12 disposal and fence tracking bugs.
Update NuGet dependencies.
Numerous minor cleanups and code improvements.
This commit is contained in:
2026-04-05 17:54:23 +09:00
parent 92970f85ef
commit effd33b285
35 changed files with 472 additions and 494 deletions

View File

@@ -79,19 +79,12 @@ public readonly unsafe ref struct RenderContext
throw new OutOfMemoryException("Failed to create upload buffer for buffer data.");
}
try
fixed (T* pData = data)
{
fixed (T* pData = data)
{
ResourceDatabase.MapResource(uploadHandle.AsResource(), 0, null, null, pData, sizeInBytes);
}
ResourceDatabase.MapResource(uploadHandle.AsResource(), 0, null, null, pData, sizeInBytes);
}
_cmd.CopyBuffer(buffer, uploadHandle, 0, 0, sizeInBytes);
}
finally
{
ResourceDatabase.ReleaseResource(uploadHandle.AsResource());
}
_cmd.CopyBuffer(buffer, uploadHandle, 0, 0, sizeInBytes);
}
}
@@ -280,25 +273,18 @@ public readonly unsafe ref struct RenderContext
throw new OutOfMemoryException("Failed to create upload buffer for texture data.");
}
try
{
TransitionBarrier(texture.AsResource(), true, BarrierLayout.CopyDest, BarrierAccess.CopyDest, BarrierSync.Copy);
TransitionBarrier(texture.AsResource(), true, BarrierLayout.CopyDest, BarrierAccess.CopyDest, BarrierSync.Copy);
fixed (T* pData = data)
fixed (T* pData = data)
{
var subresourceData = new SubResourceData
{
var subresourceData = new SubResourceData
{
pData = pData,
rowPitch = rowPitch,
slicePitch = slicePitch
};
pData = pData,
rowPitch = rowPitch,
slicePitch = slicePitch
};
_cmd.UpdateSubResources(texture.AsResource(), uploadHandle.AsResource(), subresourceData);
}
}
finally
{
ResourceDatabase.ReleaseResource(uploadHandle.AsResource());
_cmd.UpdateSubResources(texture.AsResource(), uploadHandle.AsResource(), subresourceData);
}
}
}