Hash :
081934f6
Author :
Date :
2025-03-12T15:22:31
Vulkan: Add avoidInvisibleWindowSwapchainRecreate feature There is a bug on some NVIDIA drivers on Linux X11 when `vkAcquireNextImageKHR()` constantly returns `VK_ERROR_OUT_OF_DATE_KHR` if recreate the swapchain while window is not visible. If not recreate the swapchain after window resize - nothing happens, acquire and present works without errors. But if recreate the swpahchain to the `VkSurfaceCapabilitiesKHR::currentExtent` the next `vkAcquireNextImageKHR()` will return `VK_ERROR_OUT_OF_DATE_KHR`. ANGLE will retry to recreate the swapchain one more time and fail the call. Enabling the "avoidInvisibleWindowSwapchainRecreate" feature will avoid swapchain recreation when window size changes while it is not visible. Test: angle_end2end_tests --gtest_filter=EGLSurfaceTest.ResizeInvisibleWindow/* Bug: angleproject:397848903 Bug: angleproject:42264022 Bug: angleproject:42263074 Change-Id: I48588bf467d15c0e84b923092e06a42c22084dcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6348739 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
//
// Copyright 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WindowSurfaceVkXcb.h:
// Defines the class interface for WindowSurfaceVkXcb, implementing WindowSurfaceVk.
//
#ifndef LIBANGLE_RENDERER_VULKAN_XCB_WINDOWSURFACEVKXCB_H_
#define LIBANGLE_RENDERER_VULKAN_XCB_WINDOWSURFACEVKXCB_H_
#include "libANGLE/renderer/vulkan/SurfaceVk.h"
struct xcb_connection_t;
namespace rx
{
class WindowSurfaceVkXcb : public WindowSurfaceVk
{
public:
WindowSurfaceVkXcb(const egl::SurfaceState &surfaceState,
EGLNativeWindowType window,
xcb_connection_t *conn);
private:
angle::Result createSurfaceVk(vk::ErrorContext *context) override;
angle::Result getCurrentWindowSize(vk::ErrorContext *context,
gl::Extents *extentsOut) const override;
angle::Result getWindowVisibility(vk::ErrorContext *context, bool *isVisibleOut) const override;
xcb_connection_t *mXcbConnection;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_XCB_WINDOWSURFACEVKXCB_H_