[Android] Massive Performance Problem

I’ve been trying to find out why we are unexpectedly slow on Adreno GPUs all week. I tracked the problem down to this in SDL_androidgl.c

Code:

void
Android_GLES_SwapWindow(_THIS, SDL_Window * window)
{
/* FIXME: These two functions were in the Java code, do we really need them? */
_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
_this->egl_data->eglWaitGL();
SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
}

I really can’t see any reason why we would want those two functions in our SwapWindow function. It completely eliminates any performance gains from double buffering and absolutely kills framerate.

I’m inclined to remove those lines, yet I’d like to see if someone with the
more problematic Android systems (I’m looking at you Samsung) reports any
issues with that.

2014-01-29 dbrady > I’ve been trying to find out why we are unexpectedly slow on Adreno GPUs

all week. I tracked the problem down to this in SDL_androidgl.c

Code:

void
Android_GLES_SwapWindow(_THIS, SDL_Window * window)
{
/* FIXME: These two functions were in the Java code, do we really need
them? */
_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
_this->egl_data->eglWaitGL();
SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *)
window->driverdata)->egl_surface);
}

I really can’t see any reason why we would want those two functions in our
SwapWindow function. It completely eliminates any performance gains from
double buffering and absolutely kills framerate.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.

I’ve tested it on a Galaxy S2 (T989) and Galaxy S4 (I337), and it worked fine. But both of them were running CyanogenMod 11, so it might not be the most valid of tests.

May be you can provide a test program. I have a stock Xperia Z1 (Snapdragon 800/Adreno 330) and a bunch of other Android devices.

I am using a Samsung Galaxy Tab 10.1 (Android 4.0.4) and a Samsung Galaxy Tab 2 7.0 (4.1 I believe).
No issues with performance with the Android project from 2.0.1.

I do plan to test SDL2 2.0.2 and I am willing to testing removal of those two lines (presumably the
two "_this->egl_data->eglWaitNative() and _this->egl_data->eglWaitGL()). Should I test SDL2 2.0.2
first or stick with 2.0.1?

Cheers,

AlvinOn 29/01/14 22:48, Gabriel Jacobo wrote:

I’m inclined to remove those lines, yet I’d like to see if someone with the more problematic Android
systems (I’m looking at you Samsung) reports any issues with that.

2014-01-29 dbrady <dbrady at telltalegames.com <mailto:dbrady at telltalegames.com>>

__
I've been trying to find out why we are unexpectedly slow on Adreno GPUs all week. I tracked the
problem down to this in SDL_androidgl.c




Code:	


void
Android_GLES_SwapWindow(_THIS, SDL_Window * window)
{
    /* FIXME: These two functions were in the Java code, do we really need them? */
    _this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
    _this->egl_data->eglWaitGL();
    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
}
	



I really can't see any reason why we would want those two functions in our SwapWindow function.
It completely eliminates any performance gains from double buffering and absolutely kills framerate.

_______________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I don’t know if this is related, but I have Sony Experia which slows down ( to like half the speed) after you go on onpause and return back the game. With other Andriod Devices it works fine. This is the lastest SDL code, the previous SDL did not have this issue.