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

Martin Fox mfox at openjdk.org
Tue Jul 15 19:13:48 UTC 2025


On Tue, 15 Jul 2025 05:35:44 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/native-prism-mtl/MetalContext.h line 78:
>> 
>>> 76:     id<MTLRenderCommandEncoder> phongEncoder;
>>> 77:     id<MTLRenderCommandEncoder> lastPhongEncoder;
>>> 78:     MetalShader* currentShader;
>> 
>> Might be my obj-C lack-of-knowledge - why some objects here use pointers, while others use `id<>`?
>
> They are little similar with `*` offering more type safety. But in our case we have used `id<>` for metal library objects and `*` instances of interfaces from our implementation.

Also for most Metal objects you only get a protocol name, not a class name. id<protocol\> is the way to specify a pointer to such an object. I'm not sure why Apple used this idiom throughout the Metal API.

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

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


More information about the openjfx-dev mailing list