-
Notifications
You must be signed in to change notification settings - Fork 542
8210547: [Linux] Uncontrolled framerate #1929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back tsayao! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
|
Reviewers: @kevinrushforth @lukostyra /reviewers 2 |
|
@kevinrushforth |
|
I'm not sure of the solution, but it's a starting point. |
|
@arapte If you could also take a look that would be helpful. |
|
Nice, I (Michael Z) can confirm it fixes the frame throttling here, although in a simple animation all rendered frames have a pulse-presentation latency of 33ms -- which is somewhat better than the 48ms previously. I've been doing some testing of the pulse-presentation latency, taking timestamps of the start of the pulse, the end of the render (before glXSwapBuffers), and the GL_TIMESTAMP of when glXSwapBuffers() is processed (via glQueryCounter()). Plus tracking the pulse number all the way through so they can be matched. This is some of the output with the patch: (This is in logging order, not temporal) As a comparison using the existing SwapIntervalSGI and calling glFinish() after all scenes have rendered results in a pulse-presentation latency of 16.7ms instead. Adding the glFinish() to the SwapIntervalEXT version has no effect. ??? I don't know why they'd be different given they both have the same order of pulses, but the timing code is the same. For the curious, I blogged about the timings I did yesterday, I haven't added any plots with this patch but they look the same as "Build 2" but with another frame of latency to the present times (around 33 vs 16-17ms).
Well if prism.vsync=false it wont call swapinterval and will just run at the pulse rate, plus there's javafx.animation.fullspeed? |
|
Sorry I was wrong and should've tested with more than 1 window. The change to glXSwapIntervalEXT() doesn't work properly and behaves as if glFinish() is called for each window after glXSwapBuffer(), each causing a new wait for vblank. |
While not applicable during day-to-day JavaFX use, unlimited framerate can actually be quite useful. We currently actively use |
As Michael Zucchi pointed out on the mailing list, the high framerate occurs because
glXSwapBuffers()operates asynchronously. To ensure proper synchronization, you can callglFinish()afterward, which blocks until the buffer swap is fully completed. However, when usingglXSwapIntervalSGI, the swap interval setting applies globally rather than per drawable. In contrast,glXSwapIntervalEXTprovides per-drawable control, allowing finer-grained vsync behavior.I don't know if there are scenarios when the unlimited frame rate is needed - if so we should provide a option.
See https://wikis.khronos.org/opengl/Swap_Interval
It also selects the correct visual for transparency which needs to be depth = 32 for X11.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1929/head:pull/1929$ git checkout pull/1929Update a local copy of the PR:
$ git checkout pull/1929$ git pull https://git.openjdk.org/jfx.git pull/1929/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1929View PR using the GUI difftool:
$ git pr show -t 1929Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1929.diff
Using Webrev
Link to Webrev Comment