Vulkan: Fix the debugger screenshot in headless

There's no swapchain, so reading the backbuffer asserted. Fail the
readback, and have gpu.buffer.screenshot fall back to the displayed
framebuffer.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-29 13:17:00 -06:00
1 parent 7e553b0732
commit 39b6cc0c0c
2 files changed
+10 -1

No files matched your search

+4
View File
@@ -1891,6 +1891,10 @@ bool VKContext::BlitFramebuffer(Framebuffer *srcfb, int srcX1, int srcY1, int sr
bool VKContext::CopyFramebufferToMemory(Framebuffer *srcfb, Aspect aspects, int x, int y, int w, int h, Draw::DataFormat format, void *pixels, int pixelStride, ReadbackMode mode, const char *tag) {
VKFramebuffer *src = (VKFramebuffer *)srcfb;
if (!src && vulkan_->GetSwapchain() == VK_NULL_HANDLE) {
// No backbuffer to read, as in headless.
return false;
}
int aspectMask = 0;
if (aspects & Aspect::COLOR_BIT) aspectMask |= VK_IMAGE_ASPECT_COLOR_BIT;