- 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.
33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
using Ghost.Graphics.Data;
|
|
|
|
namespace Ghost.Graphics.RHI;
|
|
|
|
public interface IResourceAllocator
|
|
{
|
|
/// <summary>
|
|
/// Creates a texture resource
|
|
/// </summary>
|
|
/// <param name="desc">Texture description</param>
|
|
/// <returns>A new texture handle point to the resource</returns>
|
|
public TextureHandle CreateTexture(ref readonly TextureDesc desc, bool tempResource = false);
|
|
|
|
/// <summary>
|
|
/// Creates a render target for off-screen rendering
|
|
/// </summary>
|
|
/// <param name="desc">Render target description</param>
|
|
/// <returns>A new render target instance</returns>
|
|
public TextureHandle CreateRenderTarget(ref readonly RenderTargetDesc desc, bool tempResource = false);
|
|
|
|
/// <summary>
|
|
/// Creates a buffer resource
|
|
/// </summary>
|
|
/// <param name="desc">Buffer description</param>
|
|
/// <returns>A new buffer handle point to the resource</returns>
|
|
public BufferHandle CreateBuffer(ref readonly BufferDesc desc, bool tempResource = false);
|
|
|
|
/// <summary>
|
|
/// Release a resource given its handle
|
|
/// </summary>
|
|
/// <param name="handle">Resource handle</param>
|
|
public void ReleaseResource(ResourceHandle handle);
|
|
} |