evas gl-x11 engine - nvidia driver - fix performance drop

this has been going on for a while. on nvidia drivers in gles mode on
x11 there is a massive perf drop to like a few fps with enough windows
if we build for egl/gles instead of opengl. it was the re-creating of
eglimages every frame. put a vendor specific workaround for this and
avoid it. it's not needed there anyway. framerate back to 60fps
smoothness afterwards.

@fix
This commit is contained in:
Carsten Haitzler 2018-07-10 16:04:01 +09:00
parent d5db69012e
commit cb9dc80fdf
3 changed files with 11 additions and 0 deletions

View File

@ -2550,6 +2550,8 @@ eng_image_native_set(void *engine, void *image, void *native)
n->ns_data.x11.multiple_buffer = 0;
else
n->ns_data.x11.multiple_buffer = 1;
if (ob->detected.no_multi_buffer_native)
n->ns_data.x11.multiple_buffer = 0;
if (!n->ns_data.x11.surface)
{

View File

@ -75,6 +75,8 @@ struct _Outbuf
unsigned char msaa;
#ifndef GL_GLES
Eina_Bool loose_binding : 1;
#else
Eina_Bool no_multi_buffer_native : 1;
#endif
} detected;

View File

@ -345,6 +345,13 @@ try_gles2:
eng_window_free(gw);
return NULL;
}
// nvidia drivers in egl/gles mode dont need re-creating of the
// eglimage ... and doign so is super slow on them, so avoid the
// multi buffer path - as it's only for nvidia and this fixes
// the performance regression there, it's fairly safe to do
// as it's not universal across all drivers.
if (strstr((const char *)vendor, "NVIDIA"))
gw->detected.no_multi_buffer_native = 1;
eglGetConfigAttrib(gw->egl_disp, gw->egl_config, EGL_DEPTH_SIZE, &val);
gw->detected.depth_buffer_size = val;