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:
parent
b6e40bcaa9
commit
cd92d0b992
@ -2994,10 +2994,6 @@ namespace dxvk {
|
|||||||
if (curView->imageInfo().sampleCount
|
if (curView->imageInfo().sampleCount
|
||||||
!= refView->imageInfo().sampleCount)
|
!= refView->imageInfo().sampleCount)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (curView->mipLevelExtent(0)
|
|
||||||
!= refView->mipLevelExtent(0))
|
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
// Set reference view. All remaining views
|
// Set reference view. All remaining views
|
||||||
// must be compatible to the reference view.
|
// must be compatible to the reference view.
|
||||||
|
@ -94,15 +94,27 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkFramebufferSize DxvkFramebuffer::computeRenderSize(
|
DxvkFramebufferSize DxvkFramebuffer::computeRenderSize(
|
||||||
const DxvkFramebufferSize& defaultSize) const {
|
const DxvkFramebufferSize& defaultSize) const {
|
||||||
if (m_renderTargets.depth.view != nullptr)
|
// Some games bind render targets of a different size and
|
||||||
return this->computeRenderTargetSize(m_renderTargets.depth.view);
|
// 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.depth.view != nullptr) {
|
||||||
if (m_renderTargets.color[i].view != nullptr)
|
DxvkFramebufferSize depthSize = this->computeRenderTargetSize(m_renderTargets.depth.view);
|
||||||
return this->computeRenderTargetSize(m_renderTargets.color[i].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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user