Skip to content

"Dynamic" swapchain #110

Description

@Try

Current swap-chain api is designed mostly of DX12. It's ok, but not the best in convenience and requires extra blit in case of Metal.
DX-like is also very hard to model on top of vulkan, requires forest of fences and semaphores.

New api idea, to make it metal-like:

Attachment img = swapchain.next(); // point of failure for VK_ERROR_OUT_OF_DATE_KHR/VK_SUBOPTIMAL_KHR

// render as usual

device.present(std::move(img)); // destructive from application side

For error handling:

  • present can deffer failure, in case of VK_ERROR_OUT_OF_DATE_KHR.
  • next can implement recovery, that is invisible to application
    • or "fail-fast" without wasting time on command recording of unusable frame

vulkan:

should be similar to conventional acquire/release flow under the hood.
'discard' is an issue - probably just hold to imageIndex.

metal:

matches metal api

dx12:

adds constraint: only one image at time can be taken from swapchain

note1:
This design, unintentionally, defined frame-discard operation: application can simply abandon image.

note2:
Is reset no longer useful? can be hidden inside next call.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions