1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-21 22:54:16 +01:00

[dxvk] Only merge clears when framebuffer size matches view size

Otherwise, we'll only clear a smaller portion of the view, which is
incorrect. Fixes a rendering issue in Fallout New Vegas with DXUP.
This commit is contained in:
Philip Rebohle 2019-02-04 07:31:17 +01:00
parent 405bd737e0
commit c451c9a95e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 24 additions and 5 deletions

View File

@ -532,11 +532,12 @@ namespace dxvk {
} }
// Check whether the render target view is an attachment // Check whether the render target view is an attachment
// of the current framebuffer. If not, we need to create // of the current framebuffer and is included entirely.
// a temporary framebuffer. // If not, we need to create a temporary framebuffer.
int32_t attachmentIndex = -1; 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); attachmentIndex = m_state.om.framebuffer->findAttachment(imageView);
if (attachmentIndex < 0) { if (attachmentIndex < 0) {

View File

@ -71,6 +71,13 @@ namespace dxvk {
} }
bool DxvkFramebuffer::isFullSize(const Rc<DxvkImageView>& 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 DxvkFramebuffer::getRenderPassFormat(const DxvkRenderTargets& renderTargets) {
DxvkRenderPassFormat format; DxvkRenderPassFormat format;

View File

@ -176,8 +176,19 @@ namespace dxvk {
* \returns \c true if the render targets are the same * \returns \c true if the render targets are the same
* as the ones used for this framebuffer object. * as the ones used for this framebuffer object.
*/ */
bool hasTargets( bool hasTargets(const DxvkRenderTargets& renderTargets);
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<DxvkImageView>& view) const;
/** /**
* \brief Generatess render pass format * \brief Generatess render pass format