aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan/vk_swapchain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_swapchain.cpp')
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp
index fdd2de2379..7418ad934e 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.cpp
+++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp
@@ -306,7 +306,17 @@ void Swapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities) {
swapchain_ci.queueFamilyIndexCount = static_cast<u32>(queue_indices.size());
swapchain_ci.pQueueFamilyIndices = queue_indices.data();
}
- static constexpr std::array view_formats{VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_SRGB};
+ // According to Vulkan spec, when using VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR,
+ // the base format (imageFormat) MUST be included in pViewFormats
+ const std::array view_formats{
+ swapchain_ci.imageFormat, // Base format MUST be first
+ VK_FORMAT_B8G8R8A8_UNORM,
+ VK_FORMAT_B8G8R8A8_SRGB,
+#ifdef ANDROID
+ VK_FORMAT_R8G8B8A8_UNORM, // Android may use RGBA
+ VK_FORMAT_R8G8B8A8_SRGB,
+#endif
+ };
VkImageFormatListCreateInfo format_list{
.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR,
.pNext = nullptr,