RFR: 8288948: Few J2DBench tests indicate lower primitive drawing performance with metal rendering pipeline [v2]

Ajit Ghaisas aghaisas at openjdk.org
Wed Jul 13 03:56:44 UTC 2022


On Tue, 12 Jul 2022 22:20:08 GMT, Phil Race <prr at openjdk.org> wrote:

>> Ajit Ghaisas has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   make method inline + clean commented line
>
> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.m line 269:
> 
>> 267:     MTLRenderer_AddVertexToBatch(fx+fw, fy);
>> 268: 
>> 269:     MTLRenderer_AddVertexToBatch(fx+fw, fy);
> 
> Why are there several duplicates here ?

Earlier logic used to draw a rectangle with MTLPrimitiveTypeLineStrip. Hence, 5 vertices were specified to  draw 4 sides of the rectangle.
Now, the logic has been changed to use MTLPrimitiveTypeLine. Hence, 4 lines need to be specified separately by specifying 8 vertices. There are duplicates since the lines are connected.

We cannot use MTLPrimitiveTypeLineStrip if we want to batch the subsequent draw calls as it draws an unwanted line between previous rectangle and current rectangle.

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

PR: https://git.openjdk.org/jdk/pull/9245



More information about the client-libs-dev mailing list