Gfx: Swapchain resize support in HAL

Created on 27 Feb 2018  路  6Comments  路  Source: gfx-rs/gfx

Vulkan allows these things that we currently don't provide:

  1. destroying swapchains
  2. providing the old swapchain in when creating a new one, which allows not only to re-use resources but also keep presenting the old image
easy hal ready for work api high

Most helpful comment

  1. We are creating swapchains from device, therefore I would suggest adding destroy_swapchain() to the device trait
  2. I would add a new argument to create_swapchain, less reference/lifetime hassle inside the SwapchainConfig struct imo.

All 6 comments

For implementation requirements, are you thinking:
For 1), add fn destroy(&self) -> (); to hal::window::Swapchain trait and actually implement that functionality for all backends?
For 2), make hal::window::SwapchainConfig also accept an optional Swapchain and then modify existing #create_swapchain() implementations to return SwapchainConfig's Swapchain if it exists?

  1. We are creating swapchains from device, therefore I would suggest adding destroy_swapchain() to the device trait
  2. I would add a new argument to create_swapchain, less reference/lifetime hassle inside the SwapchainConfig struct imo.

Do you want the actual implementations of destroy_swapchain() and optional swapchain creation from old swapchain in create_swapchain() to be a part of this issue or should it be separate issues for each backend?

@hriundel it's not a super huge thing, so I believe we can track it all here.

out of curiosity may I know if this task is somehow related to bug #1780 ?

It should be possible to close this issue as well due to resizing support in #2052 being merged. 馃憤 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Limeth picture Limeth  路  3Comments

norru picture norru  路  4Comments

kvark picture kvark  路  4Comments

kvark picture kvark  路  3Comments

kvark picture kvark  路  5Comments