-
Notifications
You must be signed in to change notification settings - Fork 953
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 crash with wpgu 0.19 when desired_maximum_frame_latency
< 3
#5088
Comments
Wumpf
added
type: bug
Something isn't working
api: dx12
Issues with DX12 or DXGI
labels
Jan 18, 2024
dtzxporter
added a commit
to dtzxporter/wgpu
that referenced
this issue
Jan 18, 2024
Fixes gfx-rs#5088. Even though we're telling DX12 that the maximum frame latency should be our non-padded value, the swap chain may request any of the buffers allocated to it.
6 tasks
nical
pushed a commit
that referenced
this issue
Jan 19, 2024
#5091) * Make sure to copy all of the buffers into the resource array for dx12. Fixes #5088. Even though we're telling DX12 that the maximum frame latency should be our non-padded value, the swap chain may request any of the buffers allocated to it. * Up the maximum frame latency on the DX12 backend to allow a larger range.
cwfitzgerald
pushed a commit
to cwfitzgerald/wgpu
that referenced
this issue
Jan 21, 2024
gfx-rs#5091) * Make sure to copy all of the buffers into the resource array for dx12. Fixes gfx-rs#5088. Even though we're telling DX12 that the maximum frame latency should be our non-padded value, the swap chain may request any of the buffers allocated to it. * Up the maximum frame latency on the DX12 backend to allow a larger range.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The default
desired_maximum_frame_latency
of 2 causes crashes with dx12.Repro steps
Run any of the wgpu examples with dx12. (it might only crash on amd? @cwfitzgerald said on matrix that it worked fine on his nvidia gpu)
Expected vs observed behavior
Expected: Doesn't crash.
Observed: Crashes immediately. (setting
desired_maximum_frame_latency
to 3 or higher doesn't crash)Extra materials
This line has a few issues
wgpu/wgpu-hal/src/dx12/mod.rs
Line 666 in adf1e3b
+1
seems to be what causes the crash and the.min(3)
means you can never have more than 3 even if you setmaximum_frame_latency
to eg. 10 because you made a video player that doesn't care about input latency but about smoothness and performance).ERROR log: ID3D12CommandQueue::ExecuteCommandLists: A command list, which writes to a swapchain back buffer, may only be executed when that back buffer is the back buffer that will be presented during the next call to Present*. Such a back buffer is also referred to as the "current back buffer". Swap Chain: 0x0000021394DF6D10:'Unnamed Object' - Current Back Buffer Buffer: 0x000002139A18A650:'Unnamed ID3D12Resource Object' - Attempted Write Buffer: 0x000002139A18F180:'Unnamed ID3D12Resource Object' [ STATE_SETTING ERROR #907: EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE]
At first I thought it was because we were creating more
swap_chain
buffers than what gets passed toSetMaximumFrameLatency
, but that was incorrect (you can have a higher number of swap_chain buffers than what you passed toSetMaximumFrameLatency
).The issue appears to be something to do with the
resources
we use when creating the wgpu-hal dx12SwapChain
beingmaximum_frame_latency
sized, but creating the rawswap_chain
withmaximum_frame_latency + 1
swap_chain_buffers
.wgpu/wgpu-hal/src/dx12/mod.rs
Line 818 in adf1e3b
Platform
wgpu 0.19, windows 11, amd 6800xt
The text was updated successfully, but these errors were encountered: