From 2f855f30a741900396aa08e8eff9726bc20afba6 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 25 Apr 2020 19:29:32 -0700 Subject: Improved surface orientation change detection in Vulkan swap chain --- Graphics/GraphicsEngine/interface/SwapChain.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/SwapChain.h b/Graphics/GraphicsEngine/interface/SwapChain.h index bda7c9f5..5a9bc956 100644 --- a/Graphics/GraphicsEngine/interface/SwapChain.h +++ b/Graphics/GraphicsEngine/interface/SwapChain.h @@ -62,14 +62,21 @@ DILIGENT_BEGIN_INTERFACE(ISwapChain, IObject) /// Returns the swap chain desctription VIRTUAL const SwapChainDesc REF METHOD(GetDesc)(THIS) CONST PURE; - /// Changes the swap chain's back buffer size + /// Changes the swap chain size - /// \param [in] NewWidth - New swap chain width, in pixels. - /// \param [in] NewHeight - New swap chain height, in pixels. + /// \param [in] NewWidth - New swap chain width (not accounting for pre-transform), in pixels. + /// \param [in] NewHeight - New swap chain height (not accounting for pre-transform), in pixels. /// \param [in] NewTransform - New surface transform, see Diligent::SURFACE_TRANSFORM. /// /// \note When resizing non-primary swap chains, the engine unbinds the /// swap chain buffers from the output. + /// + /// New width and height should not account for surface pre-transform. For example, + /// if the window size is 1920 x 1080, but the surface is rotated by 90 degrees, + /// NewWidth should still be 1920, and NewHeight should still be 1080. It is highly + /// preferable to always use SURFACE_TRANSFORM_OPTIMAL, however SURFACE_TRANSFORM_ROTATE_90 + /// will also work in this scenario. After the swap chain has been resized, its width + /// will be 1080, height will be 1920, and PreTransform will be SURFACE_TRANSFORM_ROTATE_90. VIRTUAL void METHOD(Resize)(THIS_ Uint32 NewWidth, Uint32 NewHeight, -- cgit v1.2.3