[OpenJDK 2D-Dev] RFR: 8266159: macOS ARM + Metal pipeline shows artifacts on Swing Menu with Java L&F [v3]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Tue Jun 8 07:33:18 UTC 2021


On Tue, 8 Jun 2021 07:22:48 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:

>> This PR fixes an issue exclusively seen on Apple M1 systems when SwingSet2 demo is run with uiScale=1.0.
>> 
>> **Issue :**
>> SwingSet2 Demo - As reported in JBS description
>> J2DDemo - As reported in a comment on JBS
>> 
>> **Root Cause :** 
>> DrawPixel path is used only with uiScale=1.0. 
>> MTLPrimitiveTypePoint is used to draw a pixel while encoding a render command.
>> As mentioned in the documentation -
>> https://developer.apple.com/documentation/metal/mtlprimitivetype/mtlprimitivetypepoint?language=objc
>> 
>> "The vertex shader must provide [[point_size]], or the point size is undefined."
>> 
>> In our shader functions, we do not define this point size. It is harmless on x86_64 based mac systems, but causes visual artifacts on M1 mac systems.
>> 
>> **Solution :**
>>  Explicitly define point size in shader functions that draw MTLPrimitiveTypePoint.
>
> Ajit Ghaisas has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix review comment on test

test/jdk/java/awt/Graphics/DrawOvalTest.java line 26:

> 24: /**
> 25:  * @test
> 26:  * @key headful

I feel there's nop need to have headful tag for this test as there is no frame being made visible, all rendering are into volatileimage

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

PR: https://git.openjdk.java.net/jdk/pull/4356


More information about the 2d-dev mailing list