1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[d3d9] Optimize framebuffer binding with RT mask

This commit is contained in:
Joshua Ashton 2021-07-24 21:30:59 +01:00 committed by Joshie
parent 2f22c1b53d
commit fd50eae5c2

View File

@ -5331,19 +5331,18 @@ namespace dxvk {
// target bindings are updated. Set up the attachments.
VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM;
for (UINT i = 0; i < m_state.renderTargets.size(); i++) {
if (m_state.renderTargets[i] != nullptr && !m_state.renderTargets[i]->IsNull()) {
const DxvkImageCreateInfo& rtImageInfo = m_state.renderTargets[i]->GetCommonTexture()->GetImage()->info();
for (uint32_t rt = m_boundRTs; rt; rt &= rt - 1) {
uint32_t i = bit::tzcnt(rt);
const DxvkImageCreateInfo& rtImageInfo = m_state.renderTargets[i]->GetCommonTexture()->GetImage()->info();
if (likely(sampleCount == VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM))
sampleCount = rtImageInfo.sampleCount;
else if (unlikely(sampleCount != rtImageInfo.sampleCount))
continue;
if (likely(sampleCount == VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM))
sampleCount = rtImageInfo.sampleCount;
else if (unlikely(sampleCount != rtImageInfo.sampleCount))
continue;
attachments.color[i] = {
m_state.renderTargets[i]->GetRenderTargetView(srgb),
m_state.renderTargets[i]->GetRenderTargetLayout() };
}
attachments.color[i] = {
m_state.renderTargets[i]->GetRenderTargetView(srgb),
m_state.renderTargets[i]->GetRenderTargetLayout() };
}
if (m_state.depthStencil != nullptr) {