1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 19:24:10 +01:00

[dxvk] Allow binding render targets of different sizes

In order to not cause Vulkan validation issues, we have
to reduce the framebuffer size. Fixes a regression in
Bioshock Infinite.
This commit is contained in:
Philip Rebohle 2018-05-07 20:46:20 +02:00
parent b6e40bcaa9
commit cd92d0b992
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 18 additions and 10 deletions

View File

@ -2994,10 +2994,6 @@ namespace dxvk {
if (curView->imageInfo().sampleCount
!= refView->imageInfo().sampleCount)
return false;
if (curView->mipLevelExtent(0)
!= refView->mipLevelExtent(0))
return false;
} else {
// Set reference view. All remaining views
// must be compatible to the reference view.

View File

@ -94,15 +94,27 @@ namespace dxvk {
DxvkFramebufferSize DxvkFramebuffer::computeRenderSize(
const DxvkFramebufferSize& defaultSize) const {
if (m_renderTargets.depth.view != nullptr)
return this->computeRenderTargetSize(m_renderTargets.depth.view);
// Some games bind render targets of a different size and
// expect it to work, so we'll compute the minimum size
DxvkFramebufferSize minSize = defaultSize;
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
if (m_renderTargets.color[i].view != nullptr)
return this->computeRenderTargetSize(m_renderTargets.color[i].view);
if (m_renderTargets.depth.view != nullptr) {
DxvkFramebufferSize depthSize = this->computeRenderTargetSize(m_renderTargets.depth.view);
minSize.width = std::min(minSize.width, depthSize.width);
minSize.height = std::min(minSize.height, depthSize.height);
minSize.layers = std::min(minSize.layers, depthSize.layers);
}
return defaultSize;
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
if (m_renderTargets.color[i].view != nullptr) {
DxvkFramebufferSize colorSize = this->computeRenderTargetSize(m_renderTargets.color[i].view);
minSize.width = std::min(minSize.width, colorSize.width);
minSize.height = std::min(minSize.height, colorSize.height);
minSize.layers = std::min(minSize.layers, colorSize.layers);
}
}
return minSize;
}