Author Topic: GLES 2.0 and the emulator  (Read 5464 times)

Offline robert

  • byte
  • *
  • Posts: 40
    • View Profile
GLES 2.0 and the emulator
« on: September 22, 2012, 12:04:46 pm »
Hi there,

Just to let you know that OpenGL ES 2.0 works on the emulator even if it reports it doesn't.

Please fix this: http://www.jpct.net/wiki/index.php/Using_the_emulator or let me know how to fix it.

EDIT: Forgot to say you need an Android 4.0.3+ virtual device and set the "GPU" emulation flag to true when creating it, or pass the "-gpu on" command line parameter when running the emulator from the command line.

Thank you.
« Last Edit: September 22, 2012, 12:10:49 pm by robert »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLES 2.0 and the emulator
« Reply #1 on: September 22, 2012, 05:29:44 pm »
I tried that once...it crashed my whole system pretty hard, so can't comment on it. I'll create an account for the wiki for you, so that you can edit it yourself.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLES 2.0 and the emulator
« Reply #2 on: September 22, 2012, 05:34:23 pm »
You should have received an email with the login data for the wiki...

Offline robert

  • byte
  • *
  • Posts: 40
    • View Profile
Re: GLES 2.0 and the emulator
« Reply #3 on: September 23, 2012, 02:10:33 am »
Hi Egon,

Could you please send me the e-mail again ? I've updated the e-mail in my profile, the old one is no longer valid.

Thank you.

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: GLES 2.0 and the emulator
« Reply #4 on: September 23, 2012, 02:09:09 pm »
It's working fine for me using jPCT 1.25 ES2.0 via the jellybean (4.1) Intel AVD, Intel HAX, and GPU acceleration. Performance it about the same as the phone (recent Samsung Galaxy), but it stutters every few seconds and flickers occasionally. Needs a bit of work but it's usable. 

A lot of the time I get that "Failed to allocate memory: 8" error when launching the emulator. Lowering the RAM doesn't seem to help but setting the screen resolution manually oddly seems to get it working.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLES 2.0 and the emulator
« Reply #5 on: September 23, 2012, 08:07:28 pm »
Could you please send me the e-mail again ? I've updated the e-mail in my profile, the old one is no longer valid.
I've created another account for the new address. You should get an email notification with the password.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLES 2.0 and the emulator
« Reply #6 on: September 23, 2012, 08:25:24 pm »
It's working fine for me using jPCT 1.25 ES2.0 via the jellybean (4.1) Intel AVD, Intel HAX, and GPU acceleration. Performance it about the same as the phone (recent Samsung Galaxy), but it stutters every few seconds and flickers occasionally. Needs a bit of work but it's usable. 

A lot of the time I get that "Failed to allocate memory: 8" error when launching the emulator. Lowering the RAM doesn't seem to help but setting the screen resolution manually oddly seems to get it working.
I tried it myself after remembering that i got this fatal crash with my old Radeon 5870. Now with the GTX 680, it works. I got the same memory error and fixed it in the same way...strange. The rendered image looked good, but performance is p*** poor. From a Core i7 @ 4Ghz, 16GB, GTX 680 setup, i would expect a little more than max. 7 fps in my RPG thingy @  800*480. In the dungeons, it slowed down to 4 fps...maybe because of the parallax mapping shader that i'm using. So while it worked technically, it's far too slow IMHO. At least when using OpenGL 2.0. It might be better with 1.x.

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: GLES 2.0 and the emulator
« Reply #7 on: September 24, 2012, 04:18:35 am »
I tried it myself after remembering that i got this fatal crash with my old Radeon 5870. Now with the GTX 680, it works. I got the same memory error and fixed it in the same way...strange. The rendered image looked good, but performance is p*** poor. From a Core i7 @ 4Ghz, 16GB, GTX 680 setup, i would expect a little more than max. 7 fps in my RPG thingy @  800*480. In the dungeons, it slowed down to 4 fps...maybe because of the parallax mapping shader that i'm using. So while it worked technically, it's far too slow IMHO. At least when using OpenGL 2.0. It might be better with 1.x.

I have a very similar PC setup so you should be getting much better performance than that. I'm seeing 60FPS with some OpenGL 1.0 apps at 1280x800 in Tablet mode using the Intel Android image ( the ARM7 image is still sloowwww )

Are you sure GPU acceleration is enabled? The GPU option was missing in the AVD Manager so I had to use the "-gpu on" command line option. Enter the command line at the bottom of the dialog in Eclipse->Select your project->Run Menu->Run configurations->Target.

Or send me the APK and I'll give it a test.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLES 2.0 and the emulator
« Reply #8 on: September 24, 2012, 02:43:07 pm »
Yes, it's enabled. It wouldn't even work otherwise and the driver string also states it. But in OpenGL Es 2.0, each and every pixel has to go through the vertex/fragment shaders and emulation of these (or execution on actual hardware) seems to be slow.

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: GLES 2.0 and the emulator
« Reply #9 on: September 24, 2012, 04:25:10 pm »
Yeah there is probably some heavy emulation happening in the background causing excessive performance issues. Worse yet, the emulation may be done within the Android VM CPU (linux display driver) rather than the Desktop CPU... who knows. Hopefully they will improve things at a later stage. GPU acceleration is experimental after all.

Either way, my apps perform fine (probably due to the minimal shader usage). For me it's a breath of fresh air testing my apps in the emulator rather than on the cumbersome phone.