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

Dx12 swap chain recreation doesn't handle changing the present mode. #1472

Closed
Imberflur opened this issue Jun 4, 2021 · 1 comment
Closed
Labels
help required We need community help to make this happen. type: bug Something isn't working

Comments

@Imberflur
Copy link
Contributor

Description
When present mode is changed and the swap chain recreated on the Dx12 backend the following error is produced:

DXGI ERROR: IDXGISwapChain::ResizeBuffers: Cannot add or remove the DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING flag using ResizeBuffers. [ MISCELLANEOUS ERROR #285: ]

This causes a panic:
image

ResizeBuffers is called by configure_swapchain https://github.com/gfx-rs/gfx/blob/84e02f96149207b1bafecb1924b14315930c98ee/src/backend/dx12/src/window.rs#L170

Additionally, configure_swapchain ignores config.present_mode when determining if the swapchain needs to be recreated:

if present.format == config.format && present.size == config.extent {
    self.presentation = Some(present);
    return Ok(());
}

So the bug is only observed after changing the present mode and then resizing and otherwise changing the present mode silently does nothing.

This same behavior appears to be present in the Dx11 backend code.

Repro steps
TODO

Expected vs observed behavior
Unexpected error when changing the present mode on Dx12 that doesn't occur on the other backends (i.e. Vulkan)

Extra materials

Platform
Dx12 backend
wgpu-rs 7486bdad64bb5d17b709ecccb41e063469efff88
wgpu-core 53eab747a32414232be45d47cae8a43a369395d0
gfx 27a1dae3796d33d23812f2bb8c7e3b5aea18b521

@kvark kvark added help required We need community help to make this happen. type: bug Something isn't working labels Jun 4, 2021
@cwfitzgerald
Copy link
Member

Closing due to hal rewrite

Patryk27 pushed a commit to Patryk27/wgpu that referenced this issue Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help required We need community help to make this happen. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants