Skip to content

example-22 (multiple windows) sync differently for DirectX 11 #3468

@vbousquet

Description

@vbousquet

Describe the bug
When running example-22 with VSYNC on, using a single 144Hz screen, after creating 3 additional windows, the framerate drops on DirectX 11 backend while it stays constant when using other backends.

Example-22 DX11 OpenGL Vulkan DX12
1 Window 144 FPS 144 FPS 144 FPS 144 FPS
2 Windows 144 FPS 144 FPS 144 FPS 144 FPS
3 Windows 144 FPS 144 FPS 144 FPS 144 FPS
4 Windows 72 FPS 144 FPS 144 FPS 144 FPS
5 Windows 72 FPS 144 FPS 144 FPS 144 FPS
6 Windows 72 FPS 144 FPS 144 FPS 144 FPS
7 Windows 48 FPS 144 FPS 144 FPS 144 FPS
8 Windows 48 FPS 144 FPS 144 FPS 144 FPS

To Reproduce
Steps to reproduce the behavior:

  1. Run example-22 with --d3d11, adds 3 windows (key 'c'), see that the FPS drops after the creation of the third window
  2. Run example-22 with --vk (or other backends), adds 3 windows (key 'c'), see that the FPS does not change

Expected behavior
The same behavior is expected on all backends, that is to say no FPS drop.

Screenshots
NA

Additional context
The tests were made on Windows 11 RTX4070 and Windows 10 RTX 2060 Super, using NVidia drivers 580.97 (and previous versions).

As the drop of FPS is an integral divider and disappear when VSYNC is off, I supposed that unwanted additional VSYNC wait were perfomed by DirectX11. Therefore, I tried the following things:

  • modify the Present call of additional windows to use a syncInterval of 0 for all windows but the first (actually disabling VSYNC on anciliary windows) which seems to solve the problem.
  • adjust init.resolution.maxFrameLatency which did not have any effect (I expected it to modify the number of windows causing the FPS drop, as I suspected default DX11 frame queue synchronization to be the source of the issue)

So far, I do not fully understand the cause of the problem. I guess that the synchronization primitives that BGFX do for DX12 does a better job than the automatic ones performed by DX11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions