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:
@@ -2,6 +2,7 @@ using Ghost.Core;
|
||||
using Ghost.Core.Graphics;
|
||||
using Ghost.Graphics.Core;
|
||||
using Ghost.Graphics.D3D12.Utilities;
|
||||
using Misaki.HighPerformance.Mathematics;
|
||||
using Misaki.HighPerformance.Utilities;
|
||||
using System.IO.Hashing;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -203,6 +204,43 @@ public readonly struct CBufferInfo
|
||||
}
|
||||
}
|
||||
|
||||
public struct RenderDesc
|
||||
{
|
||||
public float4x4 ViewMatrix
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public float4x4 ProjectionMatrix
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public float4 CameraPosition
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
// The "Target" (Where to write pixels)
|
||||
public Handle<Texture> Target
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public Handle<Texture> DepthTarget
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public RectDesc Viewport
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
//public RenderPathID RenderPath;
|
||||
//public LayerMask CullingMask;
|
||||
}
|
||||
|
||||
public struct ViewportDesc
|
||||
{
|
||||
public float X
|
||||
@@ -737,11 +775,6 @@ public struct SwapChainDesc
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public uint BufferCount
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -819,6 +852,7 @@ public enum ResourceState
|
||||
CopySource = 1 << 8,
|
||||
GenericRead = 1 << 9,
|
||||
IndirectArgument = 1 << 10,
|
||||
NonPixelShaderResource = 1 << 11,
|
||||
Present = 0,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Ghost.Core;
|
||||
using Ghost.Graphics.Contracts;
|
||||
|
||||
namespace Ghost.Graphics.RHI;
|
||||
@@ -47,18 +48,8 @@ public interface IGraphicsEngine : IDisposable
|
||||
/// <returns>A new swap chain instance</returns>
|
||||
ISwapChain CreateSwapChain(SwapChainDesc desc);
|
||||
|
||||
/// <summary>
|
||||
/// Begins a new rendering frame, preparing the graphics context for drawing operations.
|
||||
/// </summary>
|
||||
void BeginFrame();
|
||||
|
||||
/// <summary>
|
||||
/// Renders the current frame.
|
||||
/// </summary>
|
||||
void RenderFrame();
|
||||
|
||||
/// <summary>
|
||||
/// Completes the current rendering frame and performs any necessary finalization steps.
|
||||
/// </summary>
|
||||
void EndFrame();
|
||||
}
|
||||
|
||||
@@ -24,14 +24,6 @@ public interface ISwapChain : IDisposable
|
||||
get;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Number of back buffers
|
||||
/// </summary>
|
||||
public uint BufferCount
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current back buffer texture
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user