wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Allow disabling waiting for latency waitable object

Open marcpabst opened this issue 9 months ago • 5 comments

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 DX12 Surface, and a waitable object is only obtained when use_latency_waitable_object == true. The swap chain still gets created with the DXGI_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.

marcpabst avatar Mar 23 '25 14:03 marcpabst

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 :)

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.

marcpabst avatar Apr 01 '25 20:04 marcpabst

Oh yes, very true, I wouldn't expect there to be any side effects for d3d12.

cwfitzgerald avatar Apr 09 '25 18:04 cwfitzgerald

Looks good, some small nits, then g2g

cwfitzgerald avatar Apr 17 '25 21:04 cwfitzgerald

Hey, just following up on this :)

cwfitzgerald avatar May 29 '25 22:05 cwfitzgerald

Thanks for following up! Let's get this merged. I'll need to finish a few other things first but will look into this later today!

marcpabst avatar Jun 03 '25 12:06 marcpabst

Boop :)

cwfitzgerald avatar Jun 25 '25 18:06 cwfitzgerald

Sorry for the long pause - should be ready to merge now!

marcpabst avatar Jul 12 '25 16:07 marcpabst

Rebased & fixed up. Good to merge once ci is green

Wumpf avatar Aug 10 '25 09:08 Wumpf

actually, not yet. Needs a changelog entry, adding one

Wumpf avatar Aug 10 '25 09:08 Wumpf