Skip to content

Redesign Framebuffer/Swapchain: Swapchain now owns an internal Frameb…#73

Merged
samcake merged 2 commits into
mainfrom
claudio
Apr 18, 2026
Merged

Redesign Framebuffer/Swapchain: Swapchain now owns an internal Frameb…#73
samcake merged 2 commits into
mainfrom
claudio

Conversation

@samcake
Copy link
Copy Markdown
Owner

@samcake samcake commented Apr 18, 2026

No description provided.

samcake added 2 commits April 17, 2026 21:50
…uffer

Splits the Swapchain's dual role (OS present interface + implicit N-buffered
render target) into clean concerns. Swapchain internally allocates a Framebuffer
via a private backend path that shares its existing RTV/DSV heaps.

- Add FramebufferInit_Swapable for autonomous N-buffered framebuffers
- Add Framebuffer chain fields: _colorBuffers, _depthBuffers, _numBuffers,
  _currentIndex with advanceIndex(); modulo indexing unifies single and N-buffer
  addressing in beginPass/clear
- Add device API: createFramebuffer(Swapable), resizeFramebuffer, resizeTexture
- D3D12: createFramebufferFromSwapchain shares swapchain RTV/DSV heaps;
  resizeTexture replaces ID3D12Resource in-place keeping TexturePointer valid;
  rebuildFramebufferHeaps recreates descriptors after resize
- presentSwapchain syncs sw->_framebuffer->_currentIndex after DXGI present
- Fix depth texture creation: use ALLOW_DEPTH_STENCIL flag and DEPTH_WRITE
  initial state for depth formats
- Viewport renders into swapchain->framebuffer() via beginPass(fb)/clear(fb)
@samcake samcake merged commit a971c24 into main Apr 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant