diff --git a/GPU/Vulkan/FramebufferVulkan.cpp b/GPU/Vulkan/FramebufferVulkan.cpp index 5cf7ab2cbd..d6124cc467 100644 --- a/GPU/Vulkan/FramebufferVulkan.cpp +++ b/GPU/Vulkan/FramebufferVulkan.cpp @@ -434,13 +434,15 @@ void FramebufferManagerVulkan::BlitFramebufferDepth(VirtualFramebuffer *src, Vir 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 (gstate_c.Supports(GPU_SUPPORTS_ANY_COPY_IMAGE) && matchingDepthBuffer && matchingRenderSize && matchingSize) { + 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); } else 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); + */ } } diff --git a/ext/native/thin3d/thin3d.h b/ext/native/thin3d/thin3d.h index fdb68a3849..6b3a6dfac9 100644 --- a/ext/native/thin3d/thin3d.h +++ b/ext/native/thin3d/thin3d.h @@ -555,6 +555,8 @@ struct DeviceCaps { bool logicOpSupported; bool framebufferCopySupported; bool framebufferBlitSupported; + bool framebufferDepthCopySupported; + bool framebufferDepthBlitSupported; }; struct TextureDesc { diff --git a/ext/native/thin3d/thin3d_d3d11.cpp b/ext/native/thin3d/thin3d_d3d11.cpp index e7ca762369..a40d4c4bfc 100644 --- a/ext/native/thin3d/thin3d_d3d11.cpp +++ b/ext/native/thin3d/thin3d_d3d11.cpp @@ -217,6 +217,9 @@ D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *de caps_.depthRangeMinusOneToOne = false; caps_.framebufferBlitSupported = false; + caps_.framebufferCopySupported = true; + caps_.framebufferDepthBlitSupported = false; + caps_.framebufferDepthCopySupported = true; D3D11_FEATURE_DATA_D3D11_OPTIONS options{}; HRESULT result = device_->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS, &options, sizeof(options)); diff --git a/ext/native/thin3d/thin3d_d3d9.cpp b/ext/native/thin3d/thin3d_d3d9.cpp index 118bd48fab..3ac3058575 100644 --- a/ext/native/thin3d/thin3d_d3d9.cpp +++ b/ext/native/thin3d/thin3d_d3d9.cpp @@ -601,6 +601,8 @@ D3D9Context::D3D9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapterId, ID caps_.tesselationShaderSupported = false; caps_.framebufferBlitSupported = true; caps_.framebufferCopySupported = false; + caps_.framebufferDepthBlitSupported = true; + caps_.framebufferDepthCopySupported = false; if (d3d) { D3DDISPLAYMODE displayMode; d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &displayMode); diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index 1334a26e2c..36532fabe9 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -602,6 +602,7 @@ OpenGLContext::OpenGLContext() { caps_.preferredDepthBufferFormat = DataFormat::D24_S8; } caps_.framebufferBlitSupported = gl_extensions.NV_framebuffer_blit || gl_extensions.ARB_framebuffer_object; + caps_.framebufferDepthBlitSupported = caps_.framebufferBlitSupported; } OpenGLContext::~OpenGLContext() { diff --git a/ext/native/thin3d/thin3d_vulkan.cpp b/ext/native/thin3d/thin3d_vulkan.cpp index 5a371da48f..005523b991 100644 --- a/ext/native/thin3d/thin3d_vulkan.cpp +++ b/ext/native/thin3d/thin3d_vulkan.cpp @@ -658,7 +658,10 @@ VKContext::VKContext(VulkanContext *vulkan) caps_.dualSourceBlend = vulkan->GetFeaturesAvailable().dualSrcBlend != 0; caps_.framebufferBlitSupported = true; caps_.framebufferCopySupported = true; - caps_.preferredDepthBufferFormat = DataFormat::D24_S8; + caps_.framebufferDepthBlitSupported = false; // Can be checked for. + caps_.framebufferDepthCopySupported = true; // Will pretty much always be the case. + caps_.preferredDepthBufferFormat = DataFormat::D24_S8; // TODO: Ask vulkan. + device_ = vulkan->GetDevice(); queue_ = vulkan->GetGraphicsQueue();