Refactor: add command allocator & render target strategies

Major refactor of graphics infrastructure:
- Introduce ICommandAllocator and D3D12CommandAllocator for explicit command buffer management.
- Change ICommandBuffer.Begin to require an allocator.
- Add IRenderTargetStrategy abstraction with swap chain and texture implementations.
- Update IRenderer to use RenderTargetStrategy instead of direct handle.
- Add DPI scaling support to swap chains (ScaleX/ScaleY, SetScale).
- RenderSystem now supports thread-safe swap chain resize requests.
- Remove persistent copy command buffer; use per-frame allocators.
- Make Logger public/static and clean up API visibility.
- Update .editorconfig and debug layer enablement.
These changes improve modularity, DPI-awareness, and future extensibility.
This commit is contained in:
2025-12-23 00:35:34 +09:00
parent d23e701f0a
commit aa3d9c749b
24 changed files with 456 additions and 242 deletions

View File

@@ -1,5 +1,5 @@
using Ghost.Core;
using Ghost.Graphics.Core;
using Ghost.Graphics.Contracts;
namespace Ghost.Graphics.RHI;
@@ -8,21 +8,15 @@ namespace Ghost.Graphics.RHI;
/// </summary>
public interface IRenderer : IDisposable
{
Handle<Texture> RenderTarget
IRenderTargetStrategy? RenderTargetStrategy
{
get;
get; set;
}
/// <summary>
/// Sets the render Target for this renderer
/// </summary>
/// <param name="renderTarget">Render Target to render into</param>
public void SetRenderTarget(Handle<Texture> renderTarget);
/// <summary>
/// Renders a frame
/// </summary>
/// <param name="commandBuffer">Command buffer to record rendering commands into</param>
/// <param name="commandAllocator">Command allocator to use for rendering</param>
/// <returns>Result of the rendering operation</returns>
public Result Render(ICommandBuffer commandBuffer);
}
Result Render(ICommandAllocator commandAllocator);
}