vk: repair transmission + MSAA

That code was changed as part as what looked like a refactoring
unrelated to the descriptor-set change itself.
Reverting that thunk fixes the problem, however the revert doesn't 
have the layout transitions that were added.

This PR reverts back to the old behavior, but adds the layout 
transitions.

It looks like the refactored code didn't handle "auto resolve" anymore.
This commit is contained in:
Mathias Agopian
2024-06-28 12:12:27 -07:00
parent c19785b72f
commit 315c8d75bc
+19 -11
View File
@@ -1328,28 +1328,36 @@ void VulkanDriver::beginRenderPass(Handle<HwRenderTarget> rth, const RenderPassP
fbkey.resolve[i] = VK_NULL_HANDLE;
continue;
}
auto const& range = attachment.getSubresourceRange();
attachment.texture->transitionLayout(&commands, range, VulkanLayout::COLOR_ATTACHMENT);
renderPassAttachments.insert(attachment);
if (fbkey.samples == 1) {
auto const& range = attachment.getSubresourceRange();
attachment.texture->transitionLayout(&commands,
range, VulkanLayout::COLOR_ATTACHMENT);
renderPassAttachments.insert(attachment);
fbkey.color[i] = attachment.getImageView();
fbkey.resolve[i] = VK_NULL_HANDLE;
assert_invariant(fbkey.color[i]);
} else {
auto& msaaColorAttachment = rt->getMsaaColor(i);
auto const& msaaRange = attachment.getSubresourceRange();
msaaColorAttachment.texture->transitionLayout(&commands,
msaaRange, VulkanLayout::COLOR_ATTACHMENT);
renderPassAttachments.insert(msaaColorAttachment);
msaaColorAttachment.texture->transitionLayout(&commands, msaaRange,
VulkanLayout::COLOR_ATTACHMENT);
fbkey.color[i] = msaaColorAttachment.getImageView();
VulkanTexture* texture = attachment.texture;
if (texture->samples == 1) {
mRenderPassFboInfo.hasColorResolve = true;
auto const& range = attachment.getSubresourceRange();
attachment.texture->transitionLayout(&commands,
range, VulkanLayout::COLOR_ATTACHMENT);
renderPassAttachments.insert(attachment);
fbkey.resolve[i] = attachment.getImageView();
assert_invariant(fbkey.resolve[i]);
}
assert_invariant(fbkey.color[i]);
assert_invariant(attachment.texture->samples == 1);
mRenderPassFboInfo.hasColorResolve = true;
fbkey.resolve[i] = attachment.getImageView();
assert_invariant(fbkey.resolve[i]);
}
}
if (depth.texture) {