Metal crash upon adding SKSpriteNode to SKEffectNo

2019-04-04 18:46发布

-[MTLDebugRenderCommandEncoder setScissorRect:]:2028: failed assertion `(rect.x(0) + rect.width(1080))(1080) must be <= 240'

I am getting this crash when adding a simple SKSpriteNode to a SKEffectNode with the following code

    SKSpriteNode *warpSprite = [SKSpriteNode spriteNodeWithImageNamed:@"art.scnassets/symbol.png"];
    SKEffectNode *entryEffectsNode = [[SKEffectNode alloc] init];
    [entryEffectsNode addChild:warpSprite];
    [self addChild:entryEffectsNode];

I have not touched these nodes anywhere else in my project, when i change the sprite the value in (must be <=value) changes within the error.

Edit: I have replaced the sprite image with a simple spriteNodeWithColor:Size: and the (<=value) is always twice size of the sprite. Also it should be noted that the SKScene is being used as a overlay in a SceneKit scene.

I have created a seperate SKScene with the following code, which still results in the same error.

@implementation testScene

    -(id)initWithSize:(CGSize)size {
        if (self = [super initWithSize:size]) {

            SKSpriteNode *testSprite = [SKSpriteNode spriteNodeWithColor:[SKColor purpleColor] size:CGSizeMake(100, 100)];
            SKEffectNode *testEffect = [[SKEffectNode alloc] init];
            [testEffect addChild:testSprite];
            [self addChild:testEffect];

        }
        return self;
    }
@end

Edit 2: I have just tested the above scene as an overlay on a default SceneKit Project and it crashes with the same error.

Edit 3: I have reproduced this using swift. Bug report summited to Apple.

0条回答
登录 后发表回答