Skip to content

Commit

Permalink
Vulkan MSAA: Avoid creating backbuffer renderpasses with the wrong sa…
Browse files Browse the repository at this point in the history
…mple count, oops
  • Loading branch information
hrydgard committed Jan 17, 2024
1 parent b549685 commit ce2163e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Common/GPU/Vulkan/VulkanFramebuffer.h
Expand Up @@ -155,7 +155,7 @@ class VKRRenderPass {
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_;
};

Expand Down
2 changes: 1 addition & 1 deletion Common/GPU/Vulkan/VulkanQueueRunner.cpp
Expand Up @@ -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);
}

Expand Down
4 changes: 4 additions & 0 deletions Common/GPU/Vulkan/VulkanRenderManager.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit ce2163e

Please sign in to comment.