Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8245693: Lanai: [_MTLCommandEncoder dealloc]:70: failed assertion `Co…
  • Loading branch information
Alexey Ushakov committed May 27, 2020
1 parent 5a69bfb commit 37cfa9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Expand Up @@ -43,7 +43,6 @@
id<MTLTexture> buffer;
id<CAMetalDrawable> mtlDrawable;
id<MTLCommandBuffer> blitCommandBuf;
id<MTLBlitCommandEncoder> blitEncoder;
int topInset;
int leftInset;
}
Expand All @@ -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;

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

#import "MTLBlitLoops.h"

@implementation MTLLayer


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

Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -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)");
Expand Down

0 comments on commit 37cfa9f

Please sign in to comment.