On Thu, 5 Nov 2026 14:01:15 GMT, Lukasz Kostyra <[email protected]> wrote:

>> modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeSwapChain.cpp 
>> line 145:
>> 
>>> 143: {
>>> 144:     mVSyncEnabled = Internal::Config::IsVsyncEnabled();
>>> 145:     mSwapChainFlags = DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING;
>> 
>> I wanted to look up what this flag does and the docs mentioned that one 
>> should check whether it is supported on the system. What happens if it isn't?
>
> I think then SwapChain would fail to create (and the JavaFX app won't start). 
> There was earlier a comment about this flag being always added (even when we 
> enable VSync) so I do plan to change it a little bit, I'll add a check for 
> its support too.

Good question indeed.
I can give some insights in the Godot game engine, where this is indeed 
conditional:

https://github.com/godotengine/godot/blob/e6e2a874293a1304f2babf611c917f247b2d969b/drivers/d3d12/rendering_device_driver_d3d12.cpp#L2931-L2932

They check `DXGI_FEATURE_PRESENT_ALLOW_TEARING` to determine if that flag 
should be enabled.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2346#discussion_r4517308999

Reply via email to