From 7d56022a6445afa2fffe17d3cb390fd29dc49adb Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Wed, 29 Jan 2020 23:11:17 +0000 Subject: [PATCH] Make Vulkan's surface config available before the swap chain is actually created/ Change-Id: I9da1c9f513d26aa95b40f97908bfc3a54c843053 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15541 Commit-Queue: Mark Henderson Reviewed-by: Austin Eng --- src/dawn_native/vulkan/NativeSwapChainImplVk.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp b/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp index e359d7033f..a330d71165 100644 --- a/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp +++ b/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp @@ -66,6 +66,9 @@ namespace dawn_native { namespace vulkan { NativeSwapChainImpl::NativeSwapChainImpl(Device* device, VkSurfaceKHR surface) : mSurface(surface), mDevice(device) { + // Call this immediately, so that BackendBinding::GetPreferredSwapChainTextureFormat + // will return a correct result before a SwapChain is created. + UpdateSurfaceConfig(); } NativeSwapChainImpl::~NativeSwapChainImpl() {