Files
GhostEngine/Ghost.Graphics/RHI/IGraphicsEngine.cs
Misaki a39f377533 Refactor GPU resource management and rendering pipeline
- Introduced `Handle<T>` and `Identifier<T>` for lightweight, strongly-typed resource identifiers.
- Replaced `BitSet` with `UnsafeBitSet` for improved performance and memory safety.
- Refactored `Mesh` and `Material` into `MeshClass` and `MaterialClass` for better GPU resource handling.
- Added `D3D12ResourceDatabase` to centralize GPU resource tracking and lifecycle management.
- Updated `D3D12ShaderCompiler` to load shaders from disk and dynamically populate constant buffers and textures.
- Enhanced `ICommandBuffer` with new upload operations for buffers and textures.
- Refactored `Vertex` struct for simplified memory layout and better performance.
- Updated `MeshBuilder` and rendering logic to align with new resource and shader structures.
- Added `BindlessDescriptor` support to `TextureHandle` and `BufferHandle`.
- Removed unused classes and performed general cleanup.
- Updated unit tests and demos to reflect the new architecture.
2025-09-19 23:20:15 +09:00

45 lines
1.2 KiB
C#

namespace Ghost.Graphics.RHI;
public interface IGraphicsEngine : IDisposable
{
public IRenderDevice Device
{
get;
}
public IResourceDatabase ResourceDatabase
{
get;
}
public IResourceAllocator ResourceAllocator
{
get;
}
public IRenderer CreateRenderer();
/// <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>
public 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>
public ISwapChain CreateSwapChain(SwapChainDesc desc);
/// <summary>
/// Begins a new rendering frame, preparing the graphics context for drawing operations.
/// </summary>
public void BeginFrame();
/// <summary>
/// Completes the current rendering frame and performs any necessary finalization steps.
/// </summary>
public void EndFrame();
}