Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8245693: Lanai: [_MTLCommandEncoder dealloc]:70: failed assertion `Co…
  • Loading branch information
Alexey Ushakov committed May 27, 2020
1 parent 5a69bfb commit 37cfa9f0fda5f03fc40b15c450c0c57f44c8c283
Showing with 4 additions and 13 deletions.
  1. +0 −2 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.h
  2. +4 −11 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m
@@ -43,7 +43,6 @@
id<MTLTexture> buffer;
id<CAMetalDrawable> mtlDrawable;
id<MTLCommandBuffer> blitCommandBuf;
id<MTLBlitCommandEncoder> blitEncoder;
int topInset;
int leftInset;
}
@@ -55,7 +54,6 @@
@property (readwrite, assign) id<MTLTexture> buffer;
@property (readwrite, assign) id<CAMetalDrawable> mtlDrawable;
@property (readwrite, assign) id<MTLCommandBuffer> blitCommandBuf;
@property (readwrite, assign) id<MTLBlitCommandEncoder> blitEncoder;
@property (readwrite, assign) int topInset;
@property (readwrite, assign) int leftInset;

@@ -29,8 +29,6 @@
#import "LWCToolkit.h"
#import "MTLSurfaceData.h"

#import "MTLBlitLoops.h"

@implementation MTLLayer


@@ -41,7 +39,6 @@ @implementation MTLLayer
@synthesize buffer;
@synthesize mtlDrawable;
@synthesize blitCommandBuf;
@synthesize blitEncoder;
@synthesize topInset;
@synthesize leftInset;

@@ -77,12 +74,14 @@ - (id) initWithJavaLayer:(JNFWeakJObjectWrapper *)layer

- (void) blitTexture {
@autoreleasepool {
[self.blitEncoder
id <MTLBlitCommandEncoder> blitEncoder = [self.blitCommandBuf blitCommandEncoder];

[blitEncoder
copyFromTexture:self.buffer sourceSlice:0 sourceLevel:0
sourceOrigin:MTLOriginMake((jint)(self.leftInset*self.contentsScale), (jint)(self.topInset*self.contentsScale), 0)
sourceSize:MTLSizeMake(self.buffer.width, self.buffer.height, 1)
toTexture:self.mtlDrawable.texture destinationSlice:0 destinationLevel:0 destinationOrigin:MTLOriginMake(0, 0, 0)];
[self.blitEncoder endEncoding];
[blitEncoder endEncoding];

[self.blitCommandBuf presentDrawable:self.mtlDrawable];

@@ -126,12 +125,6 @@ - (void) initBlit {
return;
}

self.blitEncoder = [self.blitCommandBuf blitCommandEncoder];
if (self.blitEncoder == nil) {
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.initBlit: blitEncoder is null)");
return;
}

self.mtlDrawable = [self nextDrawable];
if (self.mtlDrawable == nil) {
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.initBlit: nextDrawable is null)");

0 comments on commit 37cfa9f

Please sign in to comment.