-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow disabling waiting for latency waitable object #7400
base: trunk
Are you sure you want to change the base?
Conversation
`wait_for_latency_object` method that allows waiting manually for the waitable handle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I missed something, seems to be missing the part where None
doesn't make a swapchain with waitable object support.
Code looks pretty darn good otherwise :)
pub unsafe fn wait_for_frame_latency_object( | ||
&self, | ||
timeout: Option<std::time::Duration>, | ||
) -> Result<bool, crate::SurfaceError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels weird being pub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was that you don't need to expose the actual waitable handle this way. So wgpu
can still handle the configuration of the swap chain and creation of the waitable object but we can abstract away the actual unsafe syscalls.
Yes, I thought that's the best way to deal with this. There's no documented downside to setting this flag, but with my (very limited) DX12 experience, that's not to say there are no side effects at all. So it might be better to at least give users an option to disable it. |
This PR allows you to skip the frame latency waitable mechanism used for the DX12 backend by adding a new option to
Dx12BackendOptions
. The options now also carry over to the DX12Surface
, and a waitable object is only obtained whenuse_latency_waitable_object == true
. The swap chain still gets created with theDXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT
flag, because I don't think there are any downsides and it lets users still obtain a waitable object themselves.Not sure if this is the best way to do this or the right place for this setting, so let me know what you think. Happy to also change the docs.