mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-20 14:17:54 -04:00
Single shadow depth image shared across MAX_FRAMES=2 in-flight GPU frames caused a race: frame N's main pass reads shadow map while frame N+1's shadow pass clears and writes it, producing visible flashing standing still and while moving. Fix: give each in-flight frame its own VkImage, VmaAllocation, VkImageView, and VkFramebuffer for the shadow depth attachment. renderShadowPass() now indexes all shadow resources by getCurrentFrame(), and layout transitions track per-frame state in shadowDepthLayout_[frame]. Cleanup loops over MAX_FRAMES=2. Descriptor sets already written per-frame; updated shadow image view binding to use the matching per-frame view.