RFR: 8258754: Gracefully fallback to the OpenGL rendering pipeline if Metal rendering pipeline initialization fails [v5]
kcr at openjdk.java.net
Fri Jan 8 19:29:10 UTC 2021
On Fri, 8 Jan 2021 19:13:19 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:
>> This implements fallback to the OpenGL rendering pipeline if Metal rendering pipeline initialization fails.
>> I have tested this fallback on 10.15.4 by stubbing code. We need real testing on a system where Metal is not available.
> Ajit Ghaisas has updated the pull request incrementally with one additional commit since the last revision:
> Cover all combinations of OGL and Metal pipelines
The logic looks correct to me (I didn't run it). I did leave one question about whether we want to initialize both pipelines in the typical case where we don't need a fallback.
src/java.desktop/macosx/classes/sun/java2d/macos/MacOSFlags.java line 126:
> 125: boolean oglAvailable = CGLGraphicsConfig.isCGLAvailable();
> 126: boolean metalAvailable = MTLGraphicsConfig.isMetalAvailable();
This will attempt to initialize both, loading both native libraries, even in the typical case where we don't fallback. Is this what we want?
Marked as reviewed by kcr (Committer).
More information about the lanai-dev