feat: Implement D3D12 resource factory and improve swap chain management

- Added D3D12ResourceFactory for creating render targets, textures, and buffers.
- Enhanced D3D12SwapChain to manage back buffer render targets and provide access to them.
- Updated D3D12Texture to utilize resource handles for better resource management.
- Removed legacy ResourceAllocator and integrated improvements for resource handling.
- Introduced new interfaces for resource factory and swap chain to streamline resource creation.
- Added support for mip levels and texture dimensions in render target and texture descriptions.
- Created new markdown files to document allocator and swap chain improvements.
This commit is contained in:
2025-09-02 19:39:34 +09:00
parent 5385141f14
commit 78cc64b1d2
20 changed files with 848 additions and 680 deletions

View File

@@ -8,17 +8,34 @@ public interface IRenderDevice : IDisposable
/// <summary>
/// Graphics command queue for rendering operations
/// </summary>
ICommandQueue GraphicsQueue { get; }
ICommandQueue GraphicsQueue
{
get;
}
/// <summary>
/// Compute command queue for compute shader operations
/// </summary>
ICommandQueue ComputeQueue { get; }
ICommandQueue ComputeQueue
{
get;
}
/// <summary>
/// Copy command queue for data transfer operations
/// </summary>
ICommandQueue CopyQueue { get; }
ICommandQueue CopyQueue
{
get;
}
/// <summary>
/// Gets the descriptor allocator for managing descriptors
/// </summary>
IDescriptorAllocator DescriptorAllocator
{
get;
}
/// <summary>
/// Creates a command buffer for recording rendering commands
@@ -33,32 +50,6 @@ public interface IRenderDevice : IDisposable
/// <param name="desc">Swap chain description</param>
/// <returns>A new swap chain instance</returns>
ISwapChain CreateSwapChain(SwapChainDesc desc);
/// <summary>
/// Creates a render target for off-screen rendering
/// </summary>
/// <param name="desc">Render target description</param>
/// <returns>A new render target instance</returns>
IRenderTarget CreateRenderTarget(RenderTargetDesc desc);
/// <summary>
/// Creates a texture resource
/// </summary>
/// <param name="desc">Texture description</param>
/// <returns>A new texture instance</returns>
ITexture CreateTexture(TextureDesc desc);
/// <summary>
/// Creates a buffer resource
/// </summary>
/// <param name="desc">Buffer description</param>
/// <returns>A new buffer instance</returns>
IBuffer CreateBuffer(BufferDesc desc);
/// <summary>
/// Gets the descriptor allocator for managing descriptors
/// </summary>
IDescriptorAllocator DescriptorAllocator { get; }
}
/// <summary>