Vulkan MSAA: Avoid creating backbuffer renderpasses with the wrong sample count, oops

This commit is contained in:
Henrik Rydgård 2024-01-17 21:41:04 +01:00
parent b5496851dc
commit ce2163eb93
3 changed files with 6 additions and 2 deletions

View File

@ -155,7 +155,7 @@ public:
private:
// TODO: Might be better off with a hashmap once the render pass type count grows really large..
VkRenderPass pass[(size_t)RenderPassType::TYPE_COUNT]{};
VkSampleCountFlagBits sampleCounts[(size_t)RenderPassType::TYPE_COUNT];
VkSampleCountFlagBits sampleCounts[(size_t)RenderPassType::TYPE_COUNT]{};
RPKey key_;
};

View File

@ -374,7 +374,7 @@ void VulkanQueueRunner::RunSteps(std::vector<VKRStep *> &steps, int curFrame, Fr
// When stepping in the GE debugger, we can end up here multiple times in a "frame".
// So only acquire once.
if (!frameData.hasAcquired) {
frameData.AcquireNextImage(vulkan_, frameDataShared);
frameData.AcquireNextImage(vulkan_);
SetBackbuffer(framebuffers_[frameData.curSwapchainImage], swapchainImages_[frameData.curSwapchainImage].image);
}

View File

@ -800,6 +800,10 @@ VKRGraphicsPipeline *VulkanRenderManager::CreateGraphicsPipeline(VKRGraphicsPipe
continue;
}
if (rpType == RenderPassType::BACKBUFFER) {
sampleCount = VK_SAMPLE_COUNT_1_BIT;
}
pipeline->pipeline[i] = Promise<VkPipeline>::CreateEmpty();
compileQueue_.push_back(CompileQueueEntry(pipeline, compatibleRenderPass->Get(vulkan_, rpType, sampleCount), rpType, sampleCount));
needsCompile = true;