mbucchia / VirtualDesktop-OpenXR

An implementation of the OpenXR standard for Virtual Desktop
MIT License
208 stars 7 forks source link

VDXR incorrectly assumes swapchains are updated every frame; shows out of order. #47

Open fredemmott opened 3 weeks ago

fredemmott commented 3 weeks ago

ANY ISSUE FILED WITHOUT THE INFORMATION REQUIRED BELOW WILL BE CLOSED WITHOUT BEING LOOKED AT. NO EXCEPTIONS.

Describe the bug

Some quad layers (e.g. OpenKneeboard) only update their swap chain when the contents has changed; this is permitted by the spec, but not handled correctly by VDXR. This leads to things going backwards, or visual artifacts.

OpenXR.log

Environment

To Reproduce

The most visible way:

  1. Launch OpenKneeboard
  2. Settings -> VR
  3. Scroll down; turn off 'Zoom when looking at kneeboard'
  4. Scroll down; reduce opacity / 'when not looking at kneeboard' to say 20%
  5. launch hello_xr -G D3D11
  6. Look directly at kneeboard (if needed, bind recentering key in openkneeboard, or click recenter button in VR settings)
  7. notice flickering for several frames; if you turn on the frame counter, in OpenKneeboard advaned settings, you can see it go backwards sometimes

This can be resolved by turning on Settings -> Advanced -> Compatibility Quirks -> OpenXR: Always update swapchains

Expected behavior

In terms of repro steps for very visible behavior, opacity should reliably change when looking at layer or not

In terms of VDXR behavior, VDXR should handle layers that re-use the same swapchain image for multiple frames.


Original report in OpenKneeboard discord: https://discord.com/channels/807359994856996915/1249705742785843252

mbucchia commented 3 weeks ago

Thanks Fred, there was a big rework of swapchains between the last 2 versions, something probably broke there in spite of my testing.

fredemmott commented 3 weeks ago

No problem - is this something that is or should be in the conformance tests?

mbucchia commented 3 weeks ago

There are tests and I ran them in addition to additional custom tests. Some of these tests specifically target stateless. I'll have to see once I look into the issue and figure out what/where the gap could be.