summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_swapchain.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-06-06 06:43:43 +0200
committerGitHub <noreply@github.com>2023-06-06 06:43:43 +0200
commitcb95d7fe1b6d81899fe6b279400da2c991e3132c (patch)
treea856ac45b1053009c4c11ee141c49d7faa4c8a19 /src/video_core/renderer_vulkan/vk_swapchain.cpp
parentMerge pull request #10611 from liamwhite/audio-deadlock (diff)
parentMerge pull request #10633 from t895/variable-surface-ratio (diff)
downloadyuzu-cb95d7fe1b6d81899fe6b279400da2c991e3132c.tar
yuzu-cb95d7fe1b6d81899fe6b279400da2c991e3132c.tar.gz
yuzu-cb95d7fe1b6d81899fe6b279400da2c991e3132c.tar.bz2
yuzu-cb95d7fe1b6d81899fe6b279400da2c991e3132c.tar.lz
yuzu-cb95d7fe1b6d81899fe6b279400da2c991e3132c.tar.xz
yuzu-cb95d7fe1b6d81899fe6b279400da2c991e3132c.tar.zst
yuzu-cb95d7fe1b6d81899fe6b279400da2c991e3132c.zip
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_swapchain.cpp')
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp
index 8c0dec590..afcf34fba 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.cpp
+++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp
@@ -107,16 +107,17 @@ VkCompositeAlphaFlagBitsKHR ChooseAlphaFlags(const VkSurfaceCapabilitiesKHR& cap
Swapchain::Swapchain(VkSurfaceKHR surface_, const Device& device_, Scheduler& scheduler_,
u32 width_, u32 height_, bool srgb)
: surface{surface_}, device{device_}, scheduler{scheduler_} {
- Create(width_, height_, srgb);
+ Create(surface_, width_, height_, srgb);
}
Swapchain::~Swapchain() = default;
-void Swapchain::Create(u32 width_, u32 height_, bool srgb) {
+void Swapchain::Create(VkSurfaceKHR surface_, u32 width_, u32 height_, bool srgb) {
is_outdated = false;
is_suboptimal = false;
width = width_;
height = height_;
+ surface = surface_;
const auto physical_device = device.GetPhysical();
const auto capabilities{physical_device.GetSurfaceCapabilitiesKHR(surface)};
@@ -266,7 +267,12 @@ void Swapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, bo
images = swapchain.GetImages();
image_count = static_cast<u32>(images.size());
+#ifdef ANDROID
+ // Android is already ordered the same as Switch.
+ image_view_format = srgb ? VK_FORMAT_R8G8B8A8_SRGB : VK_FORMAT_R8G8B8A8_UNORM;
+#else
image_view_format = srgb ? VK_FORMAT_B8G8R8A8_SRGB : VK_FORMAT_B8G8R8A8_UNORM;
+#endif
}
void Swapchain::CreateSemaphores() {