On Thu, 23 Apr 2026 19:02:29 GMT, Thorsten Fischer <[email protected]> wrote:

> Hi all,
> this is the topic I opened on the mailing list for this ticket: 
> https://mail.openjdk.org/archives/list/[email protected]/thread/XJB272UTZSNRYTQTHSALXYY4VO23DCIU/
> 
> Additional notes to the problem:
> - The error happend with a dated driver, but updating it to a recent version 
> did not fix the problem.
> - I could not reproduce the problem with a similar notebook with the same 
> old(!) driver, but newer GPU revision.
> - I can verify that the fix below seems to fix the problem: the application 
> runs now for 5 days straight, which did never happen before with that 
> machine. The application runs on the FX 17, so my 'long term test' is with 
> that branch.
> 
> Notes to the patch:
> - This patch reduces the GL calls between frames.
> - During normal rendering, currentDrawable is now null between present() and 
> createGraphics() (which sets it back to a real drawable), but it is then 
> never read. Outside that window, the only reader is clearContext() on the 
> shutdown path, which already has a null guard. currentDrawable is only 
> written in invalidateCurrentDrawable() and makeCurrent(), and only read in 
> makeCurrent() and clearContext().
> - On the shutdown path (clearContext), dummy.swapBuffers() would no longer be 
> called, which I believe is fine.
> - ES2SwapChain.dispose() on master calls drawable.dispose(), which requires 
> the drawable to be non-current. Since present() no longer parks the context 
> on the dummy, that step moves into the dispose path: 
> context.makeCurrent(null) before drawable.dispose().
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Code changes are simple but I will need to run quite a bit of testing on it 
(including on a Linux machine with proprietary NVidia driver) so it might take 
a while.

@kevinrushforth do we know anyone who could be the second reviewer for this? 
Perhaps someone to cover macOS ES2 backend - @arapte or @jayathirthrao ?

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

PR Comment: https://git.openjdk.org/jfx/pull/2159#issuecomment-4312042954

Reply via email to