Files
GhostEngine/Ghost.Graphics/RHI/IRenderDevice.cs
Misaki 78cc64b1d2 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.
2025-09-02 19:39:34 +09:00

64 lines
1.5 KiB
C#

namespace Ghost.Graphics.RHI;
/// <summary>
/// D3D12-native render device interface for creating graphics resources
/// </summary>
public interface IRenderDevice : IDisposable
{
/// <summary>
/// Graphics command queue for rendering operations
/// </summary>
ICommandQueue GraphicsQueue
{
get;
}
/// <summary>
/// Compute command queue for compute shader operations
/// </summary>
ICommandQueue ComputeQueue
{
get;
}
/// <summary>
/// Copy command queue for data transfer operations
/// </summary>
ICommandQueue CopyQueue
{
get;
}
/// <summary>
/// Gets the descriptor allocator for managing descriptors
/// </summary>
IDescriptorAllocator DescriptorAllocator
{
get;
}
/// <summary>
/// Creates a command buffer for recording rendering commands
/// </summary>
/// <param name="type">Type of command buffer to create</param>
/// <returns>A new command buffer instance</returns>
ICommandBuffer CreateCommandBuffer(CommandBufferType type = CommandBufferType.Graphics);
/// <summary>
/// Creates a swap chain for presentation
/// </summary>
/// <param name="desc">Swap chain description</param>
/// <returns>A new swap chain instance</returns>
ISwapChain CreateSwapChain(SwapChainDesc desc);
}
/// <summary>
/// Command buffer types matching D3D12 command list types
/// </summary>
public enum CommandBufferType
{
Graphics,
Compute,
Copy
}