RFR: 8375466: Metal rendering pipeline crashes on virtualized OS

Jayathirth D V jdv at openjdk.org
Wed Feb 4 03:34:18 UTC 2026


On Mon, 2 Feb 2026 13:30:40 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

> Issue:
> As described in the bug, a crash occurs on macOS VM created using Parallels.
> The crash occurs when trying to create a [MTLArgumentEncoder](https://github.com/openjdk/jfx/blob/5ac1620ac0ba20170ae9758e20893feba5ebc58b/modules/javafx.graphics/src/main/native-prism-mtl/MetalShader.m#L76C49-L76C82), which is required for creating Shaders(Both Prism and Decora)
> This crash is not observed on macOS VM created using Apple Virtualization Framework.
> 
> Fix:
> Support for MTLArgumentEncoder is mandatory for Prism Metal Rendering pipeline. Without support for MTLArgumentEncoder the Shaders cannot be created.
> In this scenario Prism should gracefully fallback to Software rendering.
> Added a check to verify if the minimum [MTLGPUFamilyMac2](https://developer.apple.com/documentation/metal/mtlgpufamily/mac2?language=objc) GPU family is supported by the platform. If not supported then Metal Pipeline cannot be used, and rendering falls back to software pipeline.

LGTM.

modules/javafx.graphics/src/main/native-prism-mtl/MetalContext.m line 1569:

> 1567:     (JNIEnv *env, jclass jClass)
> 1568: {
> 1569:     id<MTLDevice> device = MTLCreateSystemDefaultDevice();

MTLCreateSystemDefaultDevice is expensive.
In case where we return true, if there is a way to re-use `device` as part of MTLContext it should be explored in a follow-up task.

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

Marked as reviewed by jdv (Committer).

PR Review: https://git.openjdk.org/jfx/pull/2061#pullrequestreview-3748750586
PR Review Comment: https://git.openjdk.org/jfx/pull/2061#discussion_r2762001174


More information about the openjfx-dev mailing list