diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index f3c38270..8ac14d2a 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -532,11 +532,12 @@ namespace dxvk { } // Check whether the render target view is an attachment - // of the current framebuffer. If not, we need to create - // a temporary framebuffer. + // of the current framebuffer and is included entirely. + // If not, we need to create a temporary framebuffer. int32_t attachmentIndex = -1; - if (m_state.om.framebuffer != nullptr) + if (m_state.om.framebuffer != nullptr + && m_state.om.framebuffer->isFullSize(imageView)) attachmentIndex = m_state.om.framebuffer->findAttachment(imageView); if (attachmentIndex < 0) { diff --git a/src/dxvk/dxvk_framebuffer.cpp b/src/dxvk/dxvk_framebuffer.cpp index c24a7e7d..13d37a58 100644 --- a/src/dxvk/dxvk_framebuffer.cpp +++ b/src/dxvk/dxvk_framebuffer.cpp @@ -71,6 +71,13 @@ namespace dxvk { } + bool DxvkFramebuffer::isFullSize(const Rc& view) const { + return m_renderSize.width == view->mipLevelExtent(0).width + && m_renderSize.height == view->mipLevelExtent(0).height + && m_renderSize.layers == view->info().numLayers; + } + + DxvkRenderPassFormat DxvkFramebuffer::getRenderPassFormat(const DxvkRenderTargets& renderTargets) { DxvkRenderPassFormat format; diff --git a/src/dxvk/dxvk_framebuffer.h b/src/dxvk/dxvk_framebuffer.h index e25cdd6d..49133845 100644 --- a/src/dxvk/dxvk_framebuffer.h +++ b/src/dxvk/dxvk_framebuffer.h @@ -176,8 +176,19 @@ namespace dxvk { * \returns \c true if the render targets are the same * as the ones used for this framebuffer object. */ - bool hasTargets( - const DxvkRenderTargets& renderTargets); + bool hasTargets(const DxvkRenderTargets& renderTargets); + + /** + * \brief Checks whether view and framebuffer sizes match + * + * Tests whether the size of the framebuffer is the same + * as the size of one of its views. This may be \c false + * when mixing attachments with mismatched dimensions. + * \param [in] view Image view to test + * \returns \c true if \c view has the same size as + * the framebuffer. + */ + bool isFullSize(const Rc& view) const; /** * \brief Generatess render pass format