Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soundness with new swapchain model on Vulkan #3184

Open
kvark opened this issue Mar 25, 2020 · 2 comments
Open

Soundness with new swapchain model on Vulkan #3184

kvark opened this issue Mar 25, 2020 · 2 comments

Comments

@kvark
Copy link
Member

kvark commented Mar 25, 2020

Related to #3015
The latest update from LunarG says (KhronosGroup/Vulkan-ValidationLayers#12 (comment)) our approach is unsound:

Waiting on the acquire fence is not a guarantee that the submitted work has been completed, even on the same image index. The only way to guarantee this is to wait on the signaled fence from the QueueSubmit().

@kvark kvark pinned this issue Mar 27, 2020
@kvark kvark unpinned this issue May 7, 2020
bors bot added a commit to gfx-rs/portability that referenced this issue Aug 5, 2020
210: Port to the new swapchain model r=kvark a=kvark

Closes #208
Fixes #212 
Also has general fixes to:
  - push constant offsets in `gfxCreatePipelineLayout`
  - destination subresources in `gfxCmdResolveImage`

The PR is inviting for discussion: @grovesNL @msiglreith 
I'm not 100% sure what to do yet.

The Good:
  1. Being able to remove the old swapchain from gfx-rs COMPLETELY. It was hacky on all the backends other than Vulkan, quite complicated on Metal, and didn't work very in general.
  2. Fullscreen support! It's not ideal yet (occasional hitches), but it was pretty much non-functional before. In general, stuff that runs is more robust this change.

The Bad:
  1. Portability implementation is a bit more complex now, but not extraordinary so. In general, I think it's a win if we move some complication out of gfx-rs into gfx-portability, since gfx-rs has more users, it's more important to keep clean.
  2. We can't support recording a render pass that uses a swapchain image if either:
    - the image is not acquired at the moment of recording
    - the command buffer is re-usable. We expect the users to strictly acquire-record-submit-present.

The Ugly:
  1. Our KHR swapchain implementation is more limited: no support for any usage other than COLOR_ATTACHMENT. This is technically valid in Vulkan, but for some reason many apps expect to transfer to/from swapchain images. So this is fine for the matter of CTS and VkPI, but can introduce some friction in real world testing.
  2. The new swapchain model itself needs to be evolved a bit more, according to gfx-rs/gfx#3184 . We don't know how exactly: there is both a risk (that we'll need to redo something here) and an opportunity (that we'll support other usages, for example).


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
bors bot added a commit to gfx-rs/portability that referenced this issue Aug 5, 2020
210: Port to the new swapchain model r=kvark a=kvark

Closes #208
Fixes #212 
Also has general fixes to:
  - push constant offsets in `gfxCreatePipelineLayout`
  - destination subresources in `gfxCmdResolveImage`

The PR is inviting for discussion: @grovesNL @msiglreith 
I'm not 100% sure what to do yet.

The Good:
  1. Being able to remove the old swapchain from gfx-rs COMPLETELY. It was hacky on all the backends other than Vulkan, quite complicated on Metal, and didn't work very in general.
  2. Fullscreen support! It's not ideal yet (occasional hitches), but it was pretty much non-functional before. In general, stuff that runs is more robust this change.

The Bad:
  1. Portability implementation is a bit more complex now, but not extraordinary so. In general, I think it's a win if we move some complication out of gfx-rs into gfx-portability, since gfx-rs has more users, it's more important to keep clean.
  2. We can't support recording a render pass that uses a swapchain image if either:
    - the image is not acquired at the moment of recording
    - the command buffer is re-usable. We expect the users to strictly acquire-record-submit-present.

The Ugly:
  1. Our KHR swapchain implementation is more limited: no support for any usage other than COLOR_ATTACHMENT. This is technically valid in Vulkan, but for some reason many apps expect to transfer to/from swapchain images. So this is fine for the matter of CTS and VkPI, but can introduce some friction in real world testing.
  2. The new swapchain model itself needs to be evolved a bit more, according to gfx-rs/gfx#3184 . We don't know how exactly: there is both a risk (that we'll need to redo something here) and an opportunity (that we'll support other usages, for example).


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@safasofuoglu
Copy link

@kvark any updates on this? What's the blocker here; research, decision or effort?

@kvark
Copy link
Member Author

kvark commented Dec 3, 2020

There is actually an update, it's in that LunarG issue. It was re-opened, so we are blocked on them either fixing this, or stating the resolution on whether what we do is sound or not.

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

No branches or pull requests

2 participants