feat(rendering): render graph redesign — typed indices, automatic barriers, per-frame RuntimeState - #641
Merged
Conversation
… viewport resize Render graph: - Replace string-keyed hot path with flat Array<RGPass>/Array<RGResource> indexed by typed RGResourceHandle; RGAccess enum drives automatic barrier derivation via kAccessTable - Per-frame RuntimeState tracking separate from compile-time CurrentState; all render targets are transient resources owned and resized by the graph Deferred lighting pipeline: - GbufferPass writes three targets: AlbedoAO (R8G8B8A8), NormalRoughness (R16F), MetallicEmissive (R8G8B8A8); position reconstructed from depth via InvViewProj - LightingPass: Cook-Torrance PBR, directional + point lights via LightArrayUBO SSBO - UBOCameraLayout gains InvViewProj; geometry_bindings.glsl updated accordingly Viewport resize (swap-and-reuse): - Image2DBuffer reconstructed in-place at new dimensions in the same manager slot; TextureHandle stays stable so the editor ImTextureID never invalidates - Old VkFramebuffers enqueued for DeferFree before old VkImages (correct ordering); resources freed after GPU completes the current timeline value Descriptor and shader fixes: - Fragment storage buffer reflection uses operator[] instead of at() to avoid assert on uninitialised sets; descriptor pool maxSets counts all non-reserved sets * frames - AllocateFramebuffers uses stack-local VkImageView[16] to avoid scratch-arena aliasing with Device->Arena allocations inside the same loop body - Spec.Inputs/ExternalOutputs synced after swap so BeginRenderPass resolves valid ptrs
JeanPhilippeKernel
force-pushed
the
feat/render-graph-redesign
branch
from
August 21, 2026 13:31
daf1a66 to
628afba
Compare
…imp 350->128 MB All importers and AssetManager previously created intermediate sub-arenas (Engine.cpp s_*_arena -> Importer/AssetManager sub-arena), doubling virtual memory reservations at startup with no benefit. Single-level: each Initialize() now carves directly from the parent. - Import: s_gltf/assimp/envmap_arena removed; importers carve from ImportPipelineArena directly. Assimp reduced 350->128 MB. - AssetManager: Arena field changed to pointer; stores parent arena reference directly instead of creating a 400 MB sub-arena. Result: ImportPipeline 84%->62%, AssetManager 79%->actual usage only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UnorderedHashMaphot path with flatArray<RGPass>/Array<RGResource>indexed byRGResourceHandle(typeduint32_tindex + version)RGAccessenum drives barrier derivation viakAccessTable— stage, access mask, and layout are all derived automatically with zero strings on the execute pathExecute()buildsVkImageMemoryBarriers per frame fromRuntimeState(a new separate field fromCurrentState) so frame 0 correctly starts fromVK_IMAGE_LAYOUT_UNDEFINEDrather than leaking compile-time simulation stateDepthReadmaps toVK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL— compatible with MoltenVK and all desktop drivers; depth writes are disabled in the pipeline so the layout is valid for read-only depth testingIRenderGraphCallbackPassinterface is unchanged; all passSetup()/Compile()/Execute()implementations updated to use the new builder API (WriteDepthAttachment,ReadDepth,WriteColorAttachment)GraphicRendererupdated to useGetPass(name)/SetPassEnabled(name, bool)instead of directNodeMap[]accessTest plan
vkCmdBeginRenderPassdepth layout mismatch gone).glbmesh — mesh appears in viewport