LukasBanana / LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
BSD 3-Clause "New" or "Revised" License
2.03k stars 135 forks source link

[Draft] [D3D] Support variable refresh rate displays (vsync off) in borderless windowed #111

Closed duckdoom4 closed 4 months ago

duckdoom4 commented 5 months ago

I made an attempt to improve support for vsync off in borderless windowed mode. (See https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/variable-refresh-rate-displays)

The documentation recommends we no longer use DXGI_SWAP_EFFECT_DISCARD and switch to DXGI_SWAP_EFFECT_FLIP_* instead.

Still TODO:

Let me know what you think, would love your feedback :)

LukasBanana commented 5 months ago

Changes look good at first glance. I'll take a closer look and test this on Thursday.

duckdoom4 commented 4 months ago

Had a bussy week, but got the comments addressed now.

Added the fallback to the next lower factory version on failure, and added the fallback to the next swap chain version on failure by adding a new function to make it more readable

duckdoom4 commented 4 months ago

Yeah you're welcome. Happy to help. I'm actually looking at adding some other features as well so might make some more in the near future.

For example adding support for HDR framebuffer output for HDR displays.

Also I need bindless textures for a research project I'm working on. Does LLGL support that currently? I already read that dx11 does not support that,since it's a shader model 5.1 thing

LukasBanana commented 4 months ago

Added support for multi-sampled back-buffers with the FLIP swap-effect with 5778b34.