Skip to content
Permalink
Browse files

8254881: Commit commandbuffer after draw happens through JNI

  • Loading branch information
jayathirthrao committed Oct 16, 2020
1 parent febb027 commit 38e78cdea3725fc7ae05c2e53221a07149791b5f
@@ -139,6 +139,16 @@
MTLMaskFill_MaskFill(mtlc, dstOps,
x, y, w, h,
maskoff, maskscan, masklen, mask);
if (mtlc != NULL) {
RESET_PREVIOUS_OP();
[mtlc.encoderManager endEncoder];
MTLCommandBufferWrapper * cbwrapper = [mtlc pullCommandBufferWrapper];
id<MTLCommandBuffer> commandbuf = [cbwrapper getCommandBuffer];
[commandbuf addCompletedHandler:^(id <MTLCommandBuffer> commandbuf) {
[cbwrapper release];
}];
[commandbuf commit];
}
if (mask != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, maskArray, mask, JNI_ABORT);
@@ -303,6 +303,16 @@ void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps,
nPoints, isClosed,
transX, transY,
xPoints, yPoints);
if (mtlc != NULL) {
RESET_PREVIOUS_OP();
[mtlc.encoderManager endEncoder];
MTLCommandBufferWrapper * cbwrapper = [mtlc pullCommandBufferWrapper];
id<MTLCommandBuffer> commandbuf = [cbwrapper getCommandBuffer];
[commandbuf addCompletedHandler:^(id <MTLCommandBuffer> commandbuf) {
[cbwrapper release];
}];
[commandbuf commit];
}

(*env)->ReleasePrimitiveArrayCritical(env, ypointsArray, yPoints,
JNI_ABORT);
@@ -899,6 +899,16 @@ void MTLTR_FreeGlyphCaches() {
glyphListOrigX, glyphListOrigY,
images, NULL);
}
if (mtlc != NULL) {
RESET_PREVIOUS_OP();
[mtlc.encoderManager endEncoder];
MTLCommandBufferWrapper * cbwrapper = [mtlc pullCommandBufferWrapper];
id<MTLCommandBuffer> commandbuf = [cbwrapper getCommandBuffer];
[commandbuf addCompletedHandler:^(id <MTLCommandBuffer> commandbuf) {
[cbwrapper release];
}];
[commandbuf commit];
}
(*env)->ReleasePrimitiveArrayCritical(env, imgArray,
images, JNI_ABORT);

0 comments on commit 38e78cd

Please sign in to comment.