Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

8261705: Swing jtreg tests fail Metal API Validation with missing buf…

…fer binding
  • Loading branch information
jayathirthrao committed Feb 14, 2021
1 parent 7d1d38f commit 2a30ee5af6525697ff84ff80b0fd6c5b93dbc971
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.m
@@ -329,15 +329,16 @@ void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps,
J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawScanlines: dest is null");
return;
}
RETURN_IF_NULL(scanlines);
int vertexSize = NUM_OF_VERTICES_PER_SCANLINE
* scanlineCount * VERTEX_STRUCT_SIZE;
J2dTraceLn1(J2D_TRACE_INFO, "MTLRenderer_DrawScanlines: Total vertex size : %d", vertexSize);
if (vertexSize == 0) return;

id<MTLRenderCommandEncoder> mtlEncoder = [mtlc.encoderManager getRenderEncoder:dstOps];

if (mtlEncoder == nil) return;

int vertexSize = NUM_OF_VERTICES_PER_SCANLINE
* scanlineCount * VERTEX_STRUCT_SIZE;
J2dTraceLn1(J2D_TRACE_INFO, "MTLRenderer_DrawScanlines: Total vertex size : %d", vertexSize);

if (vertexSize <= SCANLINE_MAX_VERTEX_SIZE) {
struct Vertex verts[NUM_OF_VERTICES_PER_SCANLINE * scanlineCount];

0 comments on commit 2a30ee5

Please sign in to comment.