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

@@ -11,7 +11,7 @@ public interface ISwapChain : IDisposable
/// <summary>
/// Width of the swap chain back buffers
/// </summary>
public uint Width
uint Width
{
get;
}
@@ -19,7 +19,23 @@ public interface ISwapChain : IDisposable
/// <summary>
/// Height of the swap chain back buffers
/// </summary>
public uint Height
uint Height
{
get;
}
/// <summary>
/// Gets the horizontal scaling factor applied to the object. This is used for DPI scaling.
/// </summary>
float ScaleX
{
get;
}
/// <summary>
/// Gets the vertical scale factor applied to the object. This is used for DPI scaling.
/// </summary>
float ScaleY
{
get;
}
@@ -28,18 +44,31 @@ public interface ISwapChain : IDisposable
/// Gets the current back buffer texture
/// </summary>
/// <returns>Current back buffer texture</returns>
public Handle<Texture> GetCurrentBackBuffer();
Handle<Texture> GetCurrentBackBuffer();
/// <summary>
/// Gets all back buffer textures
/// </summary>
/// <returns>All back buffer textures</returns>
ReadOnlySpan<Handle<Texture>> GetBackBuffers();
/// <summary>
/// Presents the rendered frame
/// </summary>
/// <param name="vsync">Enable vertical synchronization</param>
public void Present(bool vsync = true);
void Present(bool vsync = true);
/// <summary>
/// Resizes the swap chain back buffers
/// </summary>
/// <param name="width">New Width</param>
/// <param name="height">New Height</param>
public void Resize(uint width, uint height);
void Resize(uint width, uint height);
/// <summary>
/// Sets the horizontal and vertical scaling factors for the object.
/// </summary>
/// <param name="scaleX">The factor by which to scale the object along the X-axis.</param>
/// <param name="scaleY">The factor by which to scale the object along the Y-axis.</param>
void SetScale(float scaleX, float scaleY);
}