Unify (well, almost) GetOutputFramebuffer (D3D11/GL)

This commit is contained in:
Henrik Rydgård 2017-10-16 16:27:16 +02:00
parent 214270d192
commit f2ea0ce472
8 changed files with 36 additions and 94 deletions

View file

@ -1925,3 +1925,12 @@ bool FramebufferManagerCommon::GetStencilbuffer(u32 fb_address, int fb_stride, G
return false;
#endif
}
bool FramebufferManagerCommon::GetOutputFramebuffer(GPUDebugBuffer &buffer) {
int w, h;
draw_->GetFramebufferDimensions(nullptr, &w, &h);
buffer.Allocate(w, h, GE_FORMAT_8888, false, true);
draw_->CopyFramebufferToMemorySync(nullptr, Draw::FB_COLOR_BIT, 0, 0, w, h, Draw::DataFormat::R8G8B8A8_UNORM, buffer.GetData(), w);
return true;
}