forked from Misaki/GhostEngine
Add render graph proof of concept and refactor graphics
Implemented a transient render graph system as a proof of concept, including resource aliasing, pass culling, and typed pass data. Added new project `Ghost.RenderGraph.Concept` targeting `.NET 10.0`. Refactored graphics-related components: - Simplified resource state transitions in `RenderingContext`. - Improved resize handling in `GraphicsTestWindow`. - Updated `D3D12GraphicsEngine` to streamline frame rendering. - Enhanced `D3D12ResourceDatabase` and `D3D12SwapChain` for better resource management. Added detailed documentation: - `ALIASING.md` explains resource aliasing techniques. - `API_DESIGN.md` outlines the render graph API design. Updated solution to include the new render graph project.
This commit is contained in:
41
Ghost.RenderGraph.Concept/RenderGraphResourceHandle.cs
Normal file
41
Ghost.RenderGraph.Concept/RenderGraphResourceHandle.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace Ghost.RenderGraph.Concept;
|
||||
|
||||
public class RenderGraphResourceHandle
|
||||
{
|
||||
internal int Id { get; }
|
||||
internal ResourceType Type { get; }
|
||||
internal string Name { get; }
|
||||
internal bool IsImported { get; }
|
||||
|
||||
internal RenderGraphResourceHandle(int id, ResourceType type, string name, bool isImported)
|
||||
{
|
||||
Id = id;
|
||||
Type = type;
|
||||
Name = name;
|
||||
IsImported = isImported;
|
||||
}
|
||||
|
||||
public override string ToString() => Name;
|
||||
}
|
||||
|
||||
public sealed class RenderGraphTextureHandle : RenderGraphResourceHandle
|
||||
{
|
||||
internal TextureDescriptor Descriptor { get; }
|
||||
|
||||
internal RenderGraphTextureHandle(int id, string name, TextureDescriptor descriptor, bool isImported)
|
||||
: base(id, ResourceType.Texture, name, isImported)
|
||||
{
|
||||
Descriptor = descriptor;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class RenderGraphBufferHandle : RenderGraphResourceHandle
|
||||
{
|
||||
internal BufferDescriptor Descriptor { get; }
|
||||
|
||||
internal RenderGraphBufferHandle(int id, string name, BufferDescriptor descriptor, bool isImported)
|
||||
: base(id, ResourceType.Buffer, name, isImported)
|
||||
{
|
||||
Descriptor = descriptor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user