RFR: 8271024: Implement macOS Metal Rendering Pipeline [v11]

Ambarish Rapte arapte at openjdk.org
Wed Jul 30 10:04:18 UTC 2025


On Fri, 25 Jul 2025 11:44:02 GMT, Lukasz Kostyra <lkostyra at openjdk.org> wrote:

>> Ambarish Rapte has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision:
>> 
>>  - Merge branch 'master' into impl-metal
>>  - add comment for ES2SwapChain.getFboID
>>  - remove MTLLog
>>  - andy review comments 1
>>  - changes for running apps in eclipse
>>  - review-update: jni method refactoring
>>  - add @Override
>>  - minor cleanup changes in glass
>>  - Use appropriate layer for setting opacity
>>  - Glass changes after Metal PR inputs
>>  - ... and 2 more: https://git.openjdk.org/jfx/compare/df483ca3...1a9a0a41
>
> build.gradle line 2680:
> 
>> 2678:     // Prism JSL
>> 2679:     outPkg = IS_WINDOWS ? "com/sun/prism/d3d/hlsl" : (IS_MAC ? "com/sun/prism/mtl/msl" : "")
>> 2680:     addJSL(project, "Prism", outPkg, null) { sourceDir, destinationDir ->
> 
> I'm not quite sure if this is the best way to do it when counting in other platforms. While this used to work well on Windows with ES2 and D3D being the only backends, and it works well on Mac with ES2-MTL transition, it would unfortunately fall apart when mixing in D3D12.
> 
> On D3D12 branch JSLC generates two types of shaders at once - HLSL and HLSL6. With this change, on Windows both shaders would end up in `com/sun/prism/d3d/hlsl` when they should be separated. I think we should look through this and unify the way `addJSL` is called so that it functions better for multiple shader types. This would also be helpful when eventually merging direct3d12 to this code.
> 
> I think a better approach (you can source this from `direct3d12` branch [right here - added L1710 and L2808](https://github.com/openjdk/jfx-sandbox/commit/380fc8ea06a0a3187460013b254f93df4d683b32)) would be to have a generic package prefix `com/sun/prism` here and add shader-specific suffixes inside `addJSL` compile targets. Those targets would also be enabled-disabled based on current build platform (ex. HLSL/HLSL6 are both enabled by IS_WINDOWS property, whereas MSL would be enabled by IS_MAC property).
> 
> Let me know what you think of this approach and would it work with your backend.

This seems better.
Thanks for the link to changes, it works well with metal and d3d(9).

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1824#discussion_r2238781284


More information about the openjfx-dev mailing list