From: Stanislav Vorobiov Date: Tue, 5 Nov 2013 05:50:28 +0000 (+0400) Subject: YaGL: Add OpenGL 3.1 without ES3 to supported versions X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~475^2~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1adb8151daff10408202c98ea593258803623595;p=sdk%2Femulator%2Fqemu.git YaGL: Add OpenGL 3.1 without ES3 to supported versions Even if OpenGL 3.1 doesn't support GL_ARB_ES3_compatibility we still should use it instead of 2.1 because in case of mesa 3.1 has much smaller memory footprint Change-Id: I3c27f44628c802f3d68d73a2ba06c8106005ab94 --- diff --git a/hw/yagl_apis/egl/yagl_egl_config.c b/hw/yagl_apis/egl/yagl_egl_config.c index f8996f1d47..56dceee692 100644 --- a/hw/yagl_apis/egl/yagl_egl_config.c +++ b/hw/yagl_apis/egl/yagl_egl_config.c @@ -132,7 +132,7 @@ static struct yagl_egl_config cfg->native.native_renderable = EGL_TRUE; cfg->native.renderable_type = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT; - if (dpy->backend->gl_version > yagl_gl_2) { + if (dpy->backend->gl_version >= yagl_gl_3_1_es3) { cfg->native.renderable_type |= EGL_OPENGL_ES3_BIT_KHR; } diff --git a/hw/yagl_drivers/egl_glx/yagl_egl_glx.c b/hw/yagl_drivers/egl_glx/yagl_egl_glx.c index 4d899b8c23..4d78032e40 100644 --- a/hw/yagl_drivers/egl_glx/yagl_egl_glx.c +++ b/hw/yagl_drivers/egl_glx/yagl_egl_glx.c @@ -146,13 +146,17 @@ static bool yagl_egl_glx_get_gl_version(struct yagl_egl_glx *egl_glx, YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 2.1"); *version = yagl_gl_2; res = true; - } else if (strcmp(tmp, "gl_3") == 0) { - YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 3.2"); - *version = yagl_gl_3; - res = true; - } else if (strcmp(tmp, "gl_3_es3") == 0) { + } else if (strcmp(tmp, "gl_3_1") == 0) { YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 3.1"); - *version = yagl_gl_3_es3; + *version = yagl_gl_3_1; + res = true; + } else if (strcmp(tmp, "gl_3_1_es3") == 0) { + YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 3.1 ES3"); + *version = yagl_gl_3_1_es3; + res = true; + } else if (strcmp(tmp, "gl_3_2") == 0) { + YAGL_LOG_INFO("YAGL_GL_VERSION forces OpenGL version to 3.2"); + *version = yagl_gl_3_2; res = true; } else { YAGL_LOG_CRITICAL("Bad YAGL_GL_VERSION value = %s", tmp); @@ -222,8 +226,8 @@ static bool yagl_egl_glx_get_gl_version(struct yagl_egl_glx *egl_glx, for (i = 0; i < num_extensions; ++i) { tmp = (const char*)GetStringi(GL_EXTENSIONS, i); if (strcmp(tmp, "GL_ARB_ES3_compatibility") == 0) { - YAGL_LOG_INFO("GL_ARB_ES3_compatibility supported, using OpenGL 3.1"); - *version = yagl_gl_3_es3; + YAGL_LOG_INFO("GL_ARB_ES3_compatibility supported, using OpenGL 3.1 ES3"); + *version = yagl_gl_3_1_es3; res = true; goto out; } @@ -240,13 +244,13 @@ static bool yagl_egl_glx_get_gl_version(struct yagl_egl_glx *egl_glx, if ((major > 3) || ((major == 3) && (minor >= 2))) { YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, using OpenGL 3.2"); - *version = yagl_gl_3; + *version = yagl_gl_3_2; res = true; goto out; } - YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, OpenGL 3.2 not supported, using OpenGL 2.1"); - *version = yagl_gl_2; + YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, OpenGL 3.2 not supported, using OpenGL 3.1"); + *version = yagl_gl_3_1; res = true; out: diff --git a/hw/yagl_types.h b/hw/yagl_types.h index b2b7a6323d..436757cbbc 100644 --- a/hw/yagl_types.h +++ b/hw/yagl_types.h @@ -36,10 +36,12 @@ typedef enum { /* OpenGL 2.1 or OpenGL >= 3.1 compatibility. */ yagl_gl_2 = 0, - /* OpenGL >= 3.2 core, no GL_ARB_ES3_compatibility support. */ - yagl_gl_3 = 1, + /* OpenGL >= 3.1 core. */ + yagl_gl_3_1 = 1, /* OpenGL >= 3.1 core, GL_ARB_ES3_compatibility support. */ - yagl_gl_3_es3 = 2 + yagl_gl_3_1_es3 = 2, + /* OpenGL >= 3.2 core, no GL_ARB_ES3_compatibility support. */ + yagl_gl_3_2 = 3 } yagl_gl_version; typedef bool (*yagl_api_func)(struct yagl_transport */*t*/);