fix: video recording — proper layout transitions + deferred buffer read

Three validation errors fixed:
1. vkCmdCopyImageToBuffer inside render pass → moved AFTER vkCmdEndRendering
2. Swapchain images missing TRANSFER_SRC usage → added to swapchain creation
3. Wrong layout transitions → ColorAttachment→TransferSrc→copy→ColorAttachment

Architecture change:
- CaptureFrame now only records commands (returns null)
- ReadCapturedBuffer called at start of NEXT frame (after WaitFrame/fence)
  GPU has finished by then, safe to map memory
- CapturedFrame available 1 frame late (acceptable for video)
- Image transitions: ColorAttachmentOptimal→TransferSrcOptimal→ColorAttachmentOptimal
  (present transition still works because image is back in ColorAttachmentOptimal)
This commit is contained in:
emil28092005
2026-06-19 08:52:41 +03:00
parent b6299e8048
commit 9b80ab7881
3 changed files with 25 additions and 13 deletions
Binary file not shown.