mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
demos: Allow Vulkan to determine the swapchain image count.
We currently always use 3. That's not a bad choice, but doesn't take the minImageCount/maxImageCount of the Vulkan implementation into account.
This commit is contained in:
Notes:
Henri Verbeet
2025-06-10 18:06:56 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1556
@@ -70,6 +70,7 @@ static inline void demo_window_cleanup(struct demo_window *window)
|
||||
struct demo_swapchain
|
||||
{
|
||||
IDXGISwapChain3 *swapchain;
|
||||
unsigned int buffer_count;
|
||||
};
|
||||
|
||||
static inline void demo_cleanup(struct demo *demo)
|
||||
@@ -162,6 +163,7 @@ static inline struct demo_swapchain *demo_swapchain_create(ID3D12CommandQueue *c
|
||||
if (FAILED(hr))
|
||||
goto fail;
|
||||
|
||||
swapchain->buffer_count = desc->buffer_count;
|
||||
hr = IDXGISwapChain1_QueryInterface(swapchain1, &IID_IDXGISwapChain3, (void **)&swapchain->swapchain);
|
||||
IDXGISwapChain1_Release(swapchain1);
|
||||
if (FAILED(hr))
|
||||
@@ -190,6 +192,11 @@ static inline ID3D12Resource *demo_swapchain_get_back_buffer(struct demo_swapcha
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static inline unsigned int demo_swapchain_get_back_buffer_count(struct demo_swapchain *swapchain)
|
||||
{
|
||||
return swapchain->buffer_count;
|
||||
}
|
||||
|
||||
static inline void demo_swapchain_present(struct demo_swapchain *swapchain)
|
||||
{
|
||||
IDXGISwapChain3_Present(swapchain->swapchain, 1, 0);
|
||||
|
Reference in New Issue
Block a user