Render graph: native pass merging & heap-based aliasing

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.
This commit is contained in:
2026-01-16 01:59:33 +09:00
parent ac36bbf8c7
commit 1c155f962c
51 changed files with 2002 additions and 2314 deletions

View File

@@ -17,8 +17,8 @@ internal sealed class CachedCompilation
// Physical resource aliasing mappings (logical index -> physical index)
public readonly Dictionary<int, int> logicalToPhysical = new(128);
// Physical resource metadata
public readonly List<PhysicalResourceData> physicalResources = new(32);
// Placed resource metadata
public readonly List<PlacedResourceData> placedResources = new(32);
// Resource barriers
public readonly List<ResourceBarrier> barriers = new(128);
@@ -31,21 +31,24 @@ internal sealed class CachedCompilation
compiledPassIndices.Clear();
passCulledFlags.Clear();
logicalToPhysical.Clear();
physicalResources.Clear();
placedResources.Clear();
barriers.Clear();
resourceStates.Clear();
}
}
/// <summary>
/// Physical resource data for caching.
/// Placed resource data for caching.
/// </summary>
internal struct PhysicalResourceData
internal struct PlacedResourceData
{
public int index;
public int width;
public int height;
public TextureFormat format;
public RenderGraphResourceType type;
public int heapIndex;
public ulong heapOffset;
public ulong sizeInBytes;
public TextureDescriptor textureDesc;
public BufferDescriptor bufferDesc;
public int firstUsePass;
public int lastUsePass;
}
@@ -100,7 +103,7 @@ internal sealed class RenderGraphCompilationCache
_cached.logicalToPhysical[kvp.Key] = kvp.Value;
}
_cached.physicalResources.AddRange(data.physicalResources);
_cached.placedResources.AddRange(data.placedResources);
_cached.barriers.AddRange(data.barriers);
foreach (var kvp in data.resourceStates)