RFR: 8261632: Cached text AA rendering crashes with Metal API validation

Jayathirth D V jdv at openjdk.java.net
Fri Feb 12 13:31:54 UTC 2021


On Fri, 12 Feb 2021 12:37:36 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> setVertexBytes can take maximum of 4KB data and in cases where we are exceeding this size for vertexCache in cached AA text rendering Metal API validation throws an error. We need to clamp our vertexCache size to 4KB. It resolves the issue, Sanity and Performance tests are green.
>
> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.h line 35:
> 
>> 33:  * Constants that control the size of the vertex cache.
>> 34:  */
>> 35: #define MTLVC_MAX_INDEX         250
> 
> It would be helpful to add a comment about why the max index is 250. Do you think it is worth filing a follow-up issue?

Hi Kevin,

J2DVertex size is 16 bytes and since setVertexBytes has a limit of 4KB we can have maximum of 250 J2DVertex elements. I have created https://bugs.openjdk.java.net/browse/JDK-8261650 to add the comment.

Thanks,
Jay

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

PR: https://git.openjdk.java.net/lanai/pull/185


More information about the lanai-dev mailing list