Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8262928: Commit commandbuffer and gracefully override MTLContext
  • Loading branch information
jayathirthrao committed Mar 3, 2021
1 parent 4188413 commit d3d1daaa98151147349bf49c3eb3172f71da63e4
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m
@@ -584,11 +584,17 @@ void MTLRenderQueue_CheckPreviousOp(jint op) {
jlong pSrc = NEXT_LONG(b);
jlong pDst = NEXT_LONG(b);

dstOps = (BMTLSDOps *)jlong_to_ptr(pDst);
if (mtlc != NULL) {
[mtlc.encoderManager endEncoder];
MTLCommandBufferWrapper * cbwrapper = [mtlc pullCommandBufferWrapper];
id<MTLCommandBuffer> commandbuf = [cbwrapper getCommandBuffer];
[commandbuf addCompletedHandler:^(id <MTLCommandBuffer> commandbuf) {
[cbwrapper release];
}];
[commandbuf commit];
}
mtlc = [MTLContext setSurfacesEnv:env src:pSrc dst:pDst];
dstOps = (BMTLSDOps *)jlong_to_ptr(pDst);
break;
}
case sun_java2d_pipe_BufferedOpCodes_SET_SCRATCH_SURFACE:

0 comments on commit d3d1daa

Please sign in to comment.