using Ghost.Core;
namespace Ghost.RenderGraph.Concept;
///
/// Represents a native render pass that can contain multiple merged logical passes.
/// Maps to D3D12 BeginRenderPass/EndRenderPass or Vulkan vkCmdBeginRenderPass/vkCmdEndRenderPass.
///
internal sealed class NativeRenderPass
{
public int index;
///
/// Indices of logical passes merged into this native render pass.
///
public readonly List mergedPassIndices = new(4);
///
/// Color attachments shared across all merged passes.
///
public RenderTargetInfo[] colorAttachments = new RenderTargetInfo[8];
public int colorAttachmentCount;
///
/// Depth-stencil attachment (optional).
///
public DepthStencilInfo depthAttachment;
public bool hasDepthAttachment;
///
/// Range of logical passes included in this native pass.
///
public int firstLogicalPass;
public int lastLogicalPass;
///
/// Whether UAV writes are allowed during this render pass.
///
public bool allowUAVWrites;
public void Reset()
{
index = -1;
mergedPassIndices.Clear();
colorAttachmentCount = 0;
hasDepthAttachment = false;
depthAttachment = default;
firstLogicalPass = int.MaxValue;
lastLogicalPass = -1;
allowUAVWrites = false;
}
}