Make the implementations of CopyFramebufferDepth more similar.

Also avoid matching framebuffers with bad z for copies.
This commit is contained in:
Henrik Rydgård committed 2020-09-17 20:52:45 +02:00
1 parent 181ddd842a
commit d0f7b1e30f
10 files changed
+29 -28

No files matched your search

+4 -9
View File
@@ -273,17 +273,12 @@ void FramebufferManagerVulkan::ReformatFramebufferFrom(VirtualFramebuffer *vfb,
void FramebufferManagerVulkan::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) {
bool matchingDepthBuffer = src->z_address == dst->z_address && src->z_stride != 0 && dst->z_stride != 0;
bool matchingSize = src->width == dst->width && src->height == dst->height;
bool matchingRenderSize = src->renderWidth == dst->renderWidth && src->renderHeight == dst->renderHeight;
if (matchingDepthBuffer && matchingRenderSize && matchingSize) {
// TODO: Currently, this copies depth AND stencil, which is a problem. See #9740.
draw_->CopyFramebufferImage(src->fbo, 0, 0, 0, 0, dst->fbo, 0, 0, 0, 0, src->renderWidth, src->renderHeight, 1, Draw::FB_DEPTH_BIT, "BlitFramebufferDepth");
dst->last_frame_depth_updated = gpuStats.numFlips;
} else if (matchingDepthBuffer && matchingSize) {
/*
if (matchingDepthBuffer && matchingSize) {
int w = std::min(src->renderWidth, dst->renderWidth);
int h = std::min(src->renderHeight, dst->renderHeight);
draw_->BlitFramebuffer(src->fbo, 0, 0, w, h, dst->fbo, 0, 0, w, h, Draw::FB_DEPTH_BIT, Draw::FB_BLIT_NEAREST);
*/
// TODO: Currently, this copies depth AND stencil, which is a problem. See #9740.
draw_->CopyFramebufferImage(src->fbo, 0, 0, 0, 0, dst->fbo, 0, 0, 0, 0, w, h, 1, Draw::FB_DEPTH_BIT, "BlitFramebufferDepth");
dst->last_frame_depth_updated = gpuStats.numFlips;
}
}