Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL error 0x0502 on Android Emulator #18705

Closed
deguilardi opened this issue Feb 28, 2018 · 12 comments
Closed

OpenGL error 0x0502 on Android Emulator #18705

deguilardi opened this issue Feb 28, 2018 · 12 comments
Milestone

Comments

@deguilardi
Copy link

  • cocos2d-x version: 3.16
  • devices test on: emulator pixel 2xl
  • developing environments
    • NDK version: r16b

Steps to Reproduce:

  1. Call ParticleSystemQuad::create( "ANY_PALIST_FILE" );

You will see a black screen and a bunch of the error below every second
02-28 15:25:19.608 18887-18932/com.guilardi.conectaletra D/cocos2d-x debug info: OpenGL error 0x0502 in /Users/deguilardi/cocosWorkspace/conecta-letra/proj.conectaletra.android-studio/app/jni/../../../../lib-cocos2d/cocos/./renderer/CCRenderer.cpp restoreRenderState 189

@drelaptop
Copy link
Contributor

fixed before 3.17 release, at #18606

@CocosDeveloper541
Copy link

On the latest commit (29 september 2018) and NDK 18 the issue is still exists.
(Particles, emulator, BLACK SCREEN)

OpenGL error 0x0502 in ...\cocos\renderer\CCRenderer.cpp restoreRenderState 188
OpenGL error 0x0502 in ...\cocos\renderer\CCRenderer.cpp restoreRenderState 188
OpenGL error 0x0502 in ...\cocos\renderer\CCRenderer.cpp saveRenderState 158
OpenGL error 0x0502 in ...\cocos\2d\CCDrawNode.cpp onDraw 350
OpenGL error 0x0502 in ...\cocos\renderer\CCTextureAtlas.cpp drawNumberOfQuads 701
OpenGL error 0x0502 in ...\cocos\renderer\CCRenderer.cpp restoreRenderState 188
OpenGL error 0x0502 in ...\cocos\renderer\CCRenderer.cpp saveRenderState 158
OpenGL error 0x0502 in ...\cocos\2d\CCDrawNode.cpp onDraw 350

@drelaptop drelaptop reopened this Oct 7, 2018
@deguilardi
Copy link
Author

What is your cocos version?

@appakabar
Copy link

I've also this kind of black screen with cocos2d-x 3.17 / ndk 16b / compile & target sdk 22 / tools version 27.0.3 / Android Studio 3.2.1 - on x86 emulators and due to a ParticleSystemQuad.

@prespondek
Copy link

I'm getting this on a regular android test device in cpptest cocos2d-x 3.17.
Goto UVAnimation test and then do something that will cause the activity to be rebuilt (I found this while changing my devices language to test localisation). Now reopen cpptest and most objects that use a custom material will be black. OpenGL error 0x0502 is getting spammed in the log.

@ncimino
Copy link

ncimino commented Dec 31, 2018

I am also seeing this in 3.17. Switching the Emulated Performance -> Graphics from "Automatic" ("Hardware - GLES 2.0") to "Software - GLES 2.0" works around this problem for me. Albeit, the performance is degraded significantly.

@chipse
Copy link

chipse commented Jul 6, 2019

I'm getting the same error repeating itself in the log when trying to use an emulator. I've only been able to create a new cocos project that works by default once.

17841-18816/com.xxxxxx.xxxxx D/cocos2d-x debug info: OpenGL error 0x0502 in /Users/username/Workspace/DevGames/Projects/GameName/cocos2d/cocos/renderer/CCTextureAtlas.cpp drawNumberOfQuads 699

17841-18816/com.xxxxxx.xxxxx D/cocos2d-x debug info: OpenGL error 0x0502 in /Users/username/Workspace/DevGames/Projects/GameName/cocos2d/cocos/renderer/CCRenderer.cpp restoreRenderState 189

@anggaaryas
Copy link

same here using 3.17. dont know what the cause . try to undo, but still not fixed

@deflinhec
Copy link
Contributor

deflinhec commented Sep 27, 2019

Using 3.17.2 also encounter this issue, after investigated it was caused by

OpenGL error 0x0502 in ... removeVertexArrayObject: ERROR: cannot delete VAO 0!

Within CCParticleSystemQuad.cpp line 550 is trying to delete vertex array object which does not exist.

if (_VAOname)
{
glDeleteVertexArrays(1, &_VAOname);
GL::bindVAO(0);
}

@deguilardi
Copy link
Author

deguilardi commented Sep 27, 2019 via email

@deflinhec
Copy link
Contributor

deflinhec commented Sep 27, 2019

iOS

  • cocos2d-x: 3.17.2
  • developing environments
    • Xcode11(11A420a)
  • Device tested
    • iPhone7(12.4.1)
    • iPhoneXs(13.0)
    • Simulator iPhone11(13.0)

OSX

  • cocos2d-x: 3.17.2
  • developing environments
    • Xcode11(11A420a)
  • Device tested
    • Mojave(10.14.4)

Android

  • cocos2d-x: 3.17.2
  • developing environments
    • Gradle 3.5.0
    • NDK r18b
  • Device tested
    • Emulator Nexus 5X (API26)
    • Emulator Pixel 2 (API26)

@minggo
Copy link
Contributor

minggo commented Sep 29, 2019

@deflinhec thanks.

@minggo minggo closed this as completed Sep 29, 2019
@minggo minggo added this to the next milestone Sep 29, 2019
igs-shawncheng added a commit to igs-shawncheng/SandBox that referenced this issue Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants