Major architecture upgrade: - Add native render pass merging (hardware pass grouping, load/store op inference) - Implement heap-based aliasing for textures & buffers (D3D12-style) - Unify resource model: buffers and textures in one registry - Extend builder API for buffer creation/usage, access flags, hints - Improve barrier/state tracking (buffer hints, indirect argument state) - Update caching, hashing, and debug output for new model - Add enums/structs: AttachmentLoadOp, StoreOp, BufferHint, etc. - D3D12 backend: support named resources, temp upload buffers, correct heap usage - Update docs, benchmarks, and project files for new features Brings render graph closer to AAA engine standards, enabling efficient memory usage, lower driver overhead, and a more flexible API.
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using Ghost.Core;
|
|
|
|
namespace Ghost.RenderGraph.Concept;
|
|
|
|
/// <summary>
|
|
/// Represents a native render pass that can contain multiple merged logical passes.
|
|
/// Maps to D3D12 BeginRenderPass/EndRenderPass or Vulkan vkCmdBeginRenderPass/vkCmdEndRenderPass.
|
|
/// </summary>
|
|
internal sealed class NativeRenderPass
|
|
{
|
|
public int index;
|
|
|
|
/// <summary>
|
|
/// Indices of logical passes merged into this native render pass.
|
|
/// </summary>
|
|
public readonly List<int> mergedPassIndices = new(4);
|
|
|
|
/// <summary>
|
|
/// Color attachments shared across all merged passes.
|
|
/// </summary>
|
|
public RenderTargetInfo[] colorAttachments = new RenderTargetInfo[8];
|
|
public int colorAttachmentCount;
|
|
|
|
/// <summary>
|
|
/// Depth-stencil attachment (optional).
|
|
/// </summary>
|
|
public DepthStencilInfo depthAttachment;
|
|
public bool hasDepthAttachment;
|
|
|
|
/// <summary>
|
|
/// Range of logical passes included in this native pass.
|
|
/// </summary>
|
|
public int firstLogicalPass;
|
|
public int lastLogicalPass;
|
|
|
|
/// <summary>
|
|
/// Whether UAV writes are allowed during this render pass.
|
|
/// </summary>
|
|
public bool allowUAVWrites;
|
|
|
|
public void Reset()
|
|
{
|
|
index = -1;
|
|
mergedPassIndices.Clear();
|
|
colorAttachmentCount = 0;
|
|
hasDepthAttachment = false;
|
|
depthAttachment = default;
|
|
firstLogicalPass = int.MaxValue;
|
|
lastLogicalPass = -1;
|
|
allowUAVWrites = false;
|
|
}
|
|
}
|