Metal crash upon adding SKSpriteNode to SKEffectNode

牧云@^-^@ 提交于 2020-01-01 08:18:16

问题


-[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.

来源:https://stackoverflow.com/questions/42383395/metal-crash-upon-adding-skspritenode-to-skeffectnode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!