更新到iOS 5.1后出现多个openGL错误

时间:2012-03-12 04:41:28

标签: iphone opengl-es cocos2d-iphone

我正在使用cocos2d v2.0 beta2开发游戏。由于我使用iOS5.0一切都很好。 Esterday我将我的macOS更新到最新版本,xCode从4.2更新到4.3.1,iPad的操作系统从5.0更新到5.1。现在我正在构建我的项目,将其安装到设备(这里我可以看到一个启动画面),但是,我得到了这个:

2012-03-12 10:26:32.495 squirrels[330:707] cocos2d: OS version: 5.1 (0x05010000)
2012-03-12 10:26:32.498 squirrels[330:707] cocos2d: GL_VENDOR:   Imagination Technologies
2012-03-12 10:26:32.501 squirrels[330:707] cocos2d: GL_RENDERER: PowerVR SGX 543
2012-03-12 10:26:32.503 squirrels[330:707] cocos2d: GL_VERSION:  OpenGL ES 2.0 IMGSGX543-63.24
2012-03-12 10:26:32.505 squirrels[330:707] cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2012-03-12 10:26:32.507 squirrels[330:707] cocos2d: GL_MAX_TEXTURE_UNITS: 8
2012-03-12 10:26:32.508 squirrels[330:707] cocos2d: GL_MAX_SAMPLES: 4
2012-03-12 10:26:32.510 squirrels[330:707] cocos2d: GL supports PVRTC: YES
2012-03-12 10:26:32.511 squirrels[330:707] cocos2d: GL supports BGRA8888 textures: YES
2012-03-12 10:26:32.513 squirrels[330:707] cocos2d: GL supports NPOT textures: YES
2012-03-12 10:26:32.515 squirrels[330:707] cocos2d: GL supports discard_framebuffer: YES
2012-03-12 10:26:32.516 squirrels[330:707] cocos2d: compiled with Profiling Support: NO
2012-03-12 10:26:32.519 squirrels[330:707] cocos2d: cocos2d v2.0.0-beta2
2012-03-12 10:26:32.522 squirrels[330:707] cocos2d: Using Director Type:CCDirectorDisplayLink
2012-03-12 10:26:32.547 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: fps_images-ipad.png
2012-03-12 10:26:32.666 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTextureColor-ipad.vsh
2012-03-12 10:26:32.669 squirrels[330:707] cocos2d: ERROR: Failed to compile vertex shader: PositionTextureColor.vsh
2012-03-12 10:26:32.673 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTextureColor-ipad.fsh
2012-03-12 10:26:32.674 squirrels[330:707] cocos2d: ERROR: Failed to compile fragment shader: PositionTextureColor.fsh
2012-03-12 10:26:32.676 squirrels[330:707] cocos2d: ERROR: Failed to link program: 1
2012-03-12 10:26:32.678 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTextureColor-ipad.vsh
2012-03-12 10:26:32.680 squirrels[330:707] cocos2d: ERROR: Failed to compile vertex shader: PositionTextureColor.vsh
2012-03-12 10:26:32.682 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTextureColorAlphaTest-ipad.fsh
2012-03-12 10:26:32.684 squirrels[330:707] cocos2d: ERROR: Failed to compile fragment shader: PositionTextureColorAlphaTest.fsh
2012-03-12 10:26:32.686 squirrels[330:707] cocos2d: ERROR: Failed to link program: 1
2012-03-12 10:26:32.688 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionColor-ipad.vsh
2012-03-12 10:26:32.690 squirrels[330:707] cocos2d: ERROR: Failed to compile vertex shader: PositionColor.vsh
2012-03-12 10:26:32.692 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionColor-ipad.fsh
2012-03-12 10:26:32.693 squirrels[330:707] cocos2d: ERROR: Failed to compile fragment shader: PositionColor.fsh
2012-03-12 10:26:32.695 squirrels[330:707] cocos2d: ERROR: Failed to link program: 1
2012-03-12 10:26:32.698 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTexture-ipad.vsh
2012-03-12 10:26:32.699 squirrels[330:707] cocos2d: ERROR: Failed to compile vertex shader: PositionTexture.vsh
2012-03-12 10:26:32.701 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTexture-ipad.fsh
2012-03-12 10:26:32.703 squirrels[330:707] cocos2d: ERROR: Failed to compile fragment shader: PositionTexture.fsh
2012-03-12 10:26:32.704 squirrels[330:707] cocos2d: ERROR: Failed to link program: 1
2012-03-12 10:26:32.707 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTexture_uColor-ipad.vsh
2012-03-12 10:26:32.708 squirrels[330:707] cocos2d: ERROR: Failed to compile vertex shader: PositionTexture_uColor.vsh
2012-03-12 10:26:32.710 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTexture_uColor-ipad.fsh
2012-03-12 10:26:32.712 squirrels[330:707] cocos2d: ERROR: Failed to compile fragment shader: PositionTexture_uColor.fsh
2012-03-12 10:26:32.714 squirrels[330:707] cocos2d: ERROR: Failed to link program: 1
2012-03-12 10:26:32.716 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTextureA8Color-ipad.vsh
2012-03-12 10:26:32.718 squirrels[330:707] cocos2d: ERROR: Failed to compile vertex shader: PositionTextureA8Color.vsh
2012-03-12 10:26:32.721 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: PositionTextureA8Color-ipad.fsh
2012-03-12 10:26:32.722 squirrels[330:707] cocos2d: ERROR: Failed to compile fragment shader: PositionTextureA8Color.fsh
2012-03-12 10:26:32.724 squirrels[330:707] cocos2d: ERROR: Failed to link program: 1
OpenGL error 0x0501 in -[CCShaderCache loadDefaultShaders] 174
OpenGL error 0x0501 in -[CCTextureAtlas initVAO] 167
OpenGL error 0x0501 in -[CCTextureAtlas initVAO] 167
OpenGL error 0x0501 in -[CCDirector setView:] 308
2012-03-12 10:26:32:729 squirrels[330:707] Retina Display Not supported
2012-03-12 10:26:32.740 squirrels[330:707] cocos2d: animation started with frame interval: 60.00
2012-03-12 10:26:32.754 squirrels[330:707] cocos2d: surface size: 1024x768
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 472
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 472
2012-03-12 10:26:32.777 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: Position_uColor-ipad.vsh
2012-03-12 10:26:32.780 squirrels[330:707] cocos2d: ERROR: Failed to compile vertex shader: Position_uColor.vsh
2012-03-12 10:26:32.786 squirrels[330:707] cocos2d: CCFileUtils: Warning file not found: Position_uColor-ipad.fsh
2012-03-12 10:26:32.788 squirrels[330:707] cocos2d: ERROR: Failed to compile fragment shader: Position_uColor.fsh
2012-03-12 10:26:32.790 squirrels[330:707] cocos2d: ERROR: Failed to link program: 1

我可以看到黑屏(没有画出来),并且跟随错误会在一秒钟内多次重复:

OpenGL error 0x0501 in DrawSolidPolygon 96
OpenGL error 0x0502 in DrawSolidPolygon 96
OpenGL error 0x0502 in DrawSegment 172
OpenGL error 0x0502 in DrawSegment 172
OpenGL error 0x0502 in -[CCSprite draw] 550
OpenGL error 0x0502 in -[CCSprite draw] 550
OpenGL error 0x0502 in -[CCSprite draw] 550
OpenGL error 0x0502 in -[CCSprite draw] 550
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 472
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 472

我在设备和模拟器5.1上都是相同的。但是我将从我的旧xCode 4.2和5.0模拟器构建此代码,它生锈了。我的问题在哪里?

1 个答案:

答案 0 :(得分:0)

问题是着色器文件。出于某种原因,xCode丢失了它们。我删除并添加它们againe到“复制捆绑资源”,从iPad删除我的应用程序,删除所有drivedData,清理和builed项目,它工作。