mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
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:
1 parent
7e553b0732
commit
39b6cc0c0c
2 files changed
+10
-1
No files matched your search
@@ -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;
|
||||
|
||||
@@ -278,7 +278,12 @@ static void GenericStreamBuffer(DebuggerRequest &req, std::function<bool(const G
|
||||
void WebSocketGPUBufferScreenshot(DebuggerRequest &req) {
|
||||
GenericStreamBuffer(req, [](const GPUDebugBuffer *&buf, bool *isFramebuffer) {
|
||||
*isFramebuffer = false;
|
||||
return GPUStepping::GPU_GetOutputFramebuffer(buf);
|
||||
if (GPUStepping::GPU_GetOutputFramebuffer(buf)) {
|
||||
return true;
|
||||
}
|
||||
// Without a backbuffer (headless Vulkan), the displayed PSP framebuffer is the closest thing.
|
||||
*isFramebuffer = true;
|
||||
return GPUStepping::GPU_GetCurrentFramebuffer(buf, GPU_DBG_FRAMEBUF_DISPLAY);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user