summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorByte <byteslice@airmail.cc>2022-10-06 20:59:40 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-10-06 21:00:54 +0200
commitdf6dffa30baefd9f1e73399c632ab4e5f6475bab (patch)
tree14803b31b6817294d40d57446f6fa94c5ff3fe9a /src/video_core/renderer_vulkan
parentmaxwell_dma: remove warnings from implemented functionality (diff)
downloadyuzu-df6dffa30baefd9f1e73399c632ab4e5f6475bab.tar
yuzu-df6dffa30baefd9f1e73399c632ab4e5f6475bab.tar.gz
yuzu-df6dffa30baefd9f1e73399c632ab4e5f6475bab.tar.bz2
yuzu-df6dffa30baefd9f1e73399c632ab4e5f6475bab.tar.lz
yuzu-df6dffa30baefd9f1e73399c632ab4e5f6475bab.tar.xz
yuzu-df6dffa30baefd9f1e73399c632ab4e5f6475bab.tar.zst
yuzu-df6dffa30baefd9f1e73399c632ab4e5f6475bab.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.cpp13
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.h2
2 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
index 444c29f68..cb7fa2078 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
@@ -145,6 +145,11 @@ VkSemaphore BlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer,
// Finish any pending renderpass
scheduler.RequestOutsideRenderPassOperationContext();
+ if (const auto swapchain_images = swapchain.GetImageCount(); swapchain_images != image_count) {
+ image_count = swapchain_images;
+ Recreate();
+ }
+
const std::size_t image_index = swapchain.GetImageIndex();
scheduler.Wait(resource_ticks[image_index]);
@@ -448,15 +453,15 @@ vk::Framebuffer BlitScreen::CreateFramebuffer(const VkImageView& image_view, VkE
void BlitScreen::CreateStaticResources() {
CreateShaders();
+ CreateSampler();
+}
+
+void BlitScreen::CreateDynamicResources() {
CreateSemaphores();
CreateDescriptorPool();
CreateDescriptorSetLayout();
CreateDescriptorSets();
CreatePipelineLayout();
- CreateSampler();
-}
-
-void BlitScreen::CreateDynamicResources() {
CreateRenderPass();
CreateFramebuffers();
CreateGraphicsPipeline();
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.h b/src/video_core/renderer_vulkan/vk_blit_screen.h
index b8c67bef0..29e2ea925 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.h
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.h
@@ -109,7 +109,7 @@ private:
MemoryAllocator& memory_allocator;
Swapchain& swapchain;
Scheduler& scheduler;
- const std::size_t image_count;
+ std::size_t image_count;
const ScreenInfo& screen_info;
vk::ShaderModule vertex_shader;