RFR: 8258754: Gracefully fallback to the OpenGL rendering pipeline if Metal rendering pipeline initialization fails [v2]
kcr at openjdk.java.net
Thu Jan 7 12:25:16 UTC 2021
On Thu, 7 Jan 2021 10:33:11 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:
>> If it is unsupported then why you should check that for every device creation? What happens if one device was created using metal and then another device will use OGL?
> I have moved the Metal framework availability check to be done only once now.
> There is still a check if MTLGraphicsConfig.getConfig() fails by any chance.
> CGraphicsDevice contains GraphicsConfiguration - which is created in the constructor - It can be either MTLGraphicsConfiguration or OpenGLConfiguration. This check needs to be done while creating the config.
> For Win32GraphicsDevice - the config is not created in the constructor, but at a later stage in getDefaultConfiguration(). So only the place of checking for OGL or falling back to GDI is different, but the concept is the same.
> The whole idea of one device using metal and another device using OGL is hypothetical. The condition check cannot pass for one device and fail for another.
I agree that it makes no sense to even consider using different pipelines on different devices. The change you made to do the check once seems best.
More information about the lanai-dev