Refactor Render Graph: unified resources, benchmarking
Major overhaul of Render Graph system: - Replaced texture handles with generic Identifier<T> for unified, type-safe resource management (textures, buffers, etc.) - Refactored resource registry and pooling for performance and extensibility - Added AccessFlags and TextureAccess for precise resource usage tracking - Split passes into Raster and Compute types; introduced builder interfaces for safer pass construction - Modernized pass setup API (SetColorAttachment, UseTexture, etc.) - Updated command buffer and context structs to use new resource system - Refactored barrier and aliasing logic for improved correctness - Integrated BenchmarkDotNet for performance/memory benchmarking - Improved blackboard type safety and removed obsolete code/extensions - Added BenchmarkDotNet NuGet package These changes make the Render Graph more extensible, efficient, and ready for future resource types and advanced features.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Ghost.Core;
|
||||
|
||||
namespace Ghost.RenderGraph.Concept;
|
||||
|
||||
// ===== Pass Data Structures =====
|
||||
@@ -5,44 +7,44 @@ namespace Ghost.RenderGraph.Concept;
|
||||
|
||||
public sealed class GBufferData : IPassData
|
||||
{
|
||||
public RenderGraphTextureHandle Albedo;
|
||||
public RenderGraphTextureHandle Normal;
|
||||
public RenderGraphTextureHandle Depth;
|
||||
public Identifier<RGTexture> Albedo;
|
||||
public Identifier<RGTexture> Normal;
|
||||
public Identifier<RGTexture> Depth;
|
||||
}
|
||||
|
||||
public sealed class LightingPassData : IPassData
|
||||
{
|
||||
public RenderGraphTextureHandle GBufferAlbedo;
|
||||
public RenderGraphTextureHandle GBufferNormal;
|
||||
public RenderGraphTextureHandle GBufferDepth;
|
||||
public RenderGraphTextureHandle OutputLighting;
|
||||
public Identifier<RGTexture> GBufferAlbedo;
|
||||
public Identifier<RGTexture> GBufferNormal;
|
||||
public Identifier<RGTexture> GBufferDepth;
|
||||
public Identifier<RGTexture> OutputLighting;
|
||||
}
|
||||
|
||||
public sealed class SSAOPassData : IPassData
|
||||
{
|
||||
public RenderGraphTextureHandle GBufferDepth;
|
||||
public RenderGraphTextureHandle GBufferNormal;
|
||||
public RenderGraphTextureHandle OutputSSAO;
|
||||
public Identifier<RGTexture> GBufferDepth;
|
||||
public Identifier<RGTexture> GBufferNormal;
|
||||
public Identifier<RGTexture> OutputSSAO;
|
||||
}
|
||||
|
||||
public sealed class BloomDownsampleData : IPassData
|
||||
{
|
||||
public RenderGraphTextureHandle Input;
|
||||
public RenderGraphTextureHandle Output;
|
||||
public Identifier<RGTexture> Input;
|
||||
public Identifier<RGTexture> Output;
|
||||
}
|
||||
|
||||
public sealed class TAAPassData : IPassData
|
||||
{
|
||||
public RenderGraphTextureHandle InputLighting;
|
||||
public RenderGraphTextureHandle OutputTAA;
|
||||
public Identifier<RGTexture> InputLighting;
|
||||
public Identifier<RGTexture> OutputTAA;
|
||||
}
|
||||
|
||||
public sealed class PostProcessingPassDataV2 : IPassData
|
||||
{
|
||||
public RenderGraphTextureHandle InputTAA;
|
||||
public RenderGraphTextureHandle InputSSAO;
|
||||
public RenderGraphTextureHandle InputBloom;
|
||||
public RenderGraphTextureHandle OutputBackbuffer;
|
||||
public Identifier<RGTexture> InputTAA;
|
||||
public Identifier<RGTexture> InputSSAO;
|
||||
public Identifier<RGTexture> InputBloom;
|
||||
public Identifier<RGTexture> OutputBackbuffer;
|
||||
}
|
||||
|
||||
public sealed class ProfilerMarkerData : IPassData
|
||||
@@ -51,5 +53,5 @@ public sealed class ProfilerMarkerData : IPassData
|
||||
|
||||
public sealed class DebugPassData : IPassData
|
||||
{
|
||||
public RenderGraphTextureHandle DebugTexture;
|
||||
public Identifier<RGTexture> DebugTexture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user