summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-12-19 17:36:14 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-12-19 18:14:25 +0900
commit3572b3bf3d19b0d0b5e2d27e5abfe4bba35511cc (patch)
tree068578ccf6b6bd038d49962fef7fe7b95c6a8257 /src/modules
parent0f6cac43e5cb211a3fce4c3ecdd91eacc3eddd83 (diff)
Evas GL: Add a warning in gl_x11 about MSAA & RGBA for GLES1
We've discovered some bugs on some drivers related to MSAA and RGBA blending. Dunno yet if the same problem can affect GLES2 as well.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 0ed2018c72..7effa53334 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -914,7 +914,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
914#ifdef GL_GLES 914#ifdef GL_GLES
915 EGLSurface egl_sfc; 915 EGLSurface egl_sfc;
916 EGLConfig egl_cfg; 916 EGLConfig egl_cfg;
917 int i, num = 0; 917 int i, num = 0, best = 0;
918 EGLConfig configs[200]; 918 EGLConfig configs[200];
919 int config_attrs[40]; 919 int config_attrs[40];
920 Eina_Bool found = EINA_FALSE; 920 Eina_Bool found = EINA_FALSE;
@@ -924,12 +924,24 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
924 /* Now we need to iterate over all EGL configurations to check the compatible 924 /* Now we need to iterate over all EGL configurations to check the compatible
925 * ones and finally check their visual ID. */ 925 * ones and finally check their visual ID. */
926 926
927 if ((cfg->depth_bits > EVAS_GL_DEPTH_NONE) &&
928 (cfg->depth_bits <= EVAS_GL_DEPTH_BIT_32))
929 depth = 8 * ((int) cfg->depth_bits);
930
931 if ((cfg->stencil_bits > EVAS_GL_STENCIL_NONE) &&
932 (cfg->stencil_bits <= EVAS_GL_STENCIL_BIT_16))
933 stencil = 1 << ((int) cfg->stencil_bits - 1);
934
935 if ((cfg->multisample_bits > EVAS_GL_MULTISAMPLE_NONE) &&
936 (cfg->multisample_bits <= EVAS_GL_MULTISAMPLE_HIGH))
937 msaa = evgl->caps.msaa_samples[(int) cfg->multisample_bits - 1];
938
927 i = 0; 939 i = 0;
928 config_attrs[i++] = EGL_SURFACE_TYPE; 940 config_attrs[i++] = EGL_SURFACE_TYPE;
929 config_attrs[i++] = EGL_PIXMAP_BIT; 941 config_attrs[i++] = EGL_PIXMAP_BIT;
930 config_attrs[i++] = EGL_RENDERABLE_TYPE; 942 config_attrs[i++] = EGL_RENDERABLE_TYPE;
931 config_attrs[i++] = EGL_OPENGL_ES_BIT; 943 config_attrs[i++] = EGL_OPENGL_ES_BIT;
932 if (cfg->color_format == EVAS_GL_RGBA_8888) 944 if (alpha)
933 { 945 {
934 config_attrs[i++] = EGL_ALPHA_SIZE; 946 config_attrs[i++] = EGL_ALPHA_SIZE;
935 config_attrs[i++] = 1; // should it be 8? 947 config_attrs[i++] = 1; // should it be 8?
@@ -940,24 +952,21 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
940 config_attrs[i++] = EGL_ALPHA_SIZE; 952 config_attrs[i++] = EGL_ALPHA_SIZE;
941 config_attrs[i++] = 0; 953 config_attrs[i++] = 0;
942 } 954 }
943 if ((cfg->depth_bits > EVAS_GL_DEPTH_NONE) && 955 if (depth)
944 (cfg->depth_bits <= EVAS_GL_DEPTH_BIT_32))
945 { 956 {
946 depth = 8 * ((int) cfg->depth_bits); 957 depth = 8 * ((int) cfg->depth_bits);
947 config_attrs[i++] = EGL_DEPTH_SIZE; 958 config_attrs[i++] = EGL_DEPTH_SIZE;
948 config_attrs[i++] = depth; 959 config_attrs[i++] = depth;
949 DBG("Requesting depth buffer size %d", depth); 960 DBG("Requesting depth buffer size %d", depth);
950 } 961 }
951 if ((cfg->stencil_bits > EVAS_GL_STENCIL_NONE) && 962 if (stencil)
952 (cfg->stencil_bits <= EVAS_GL_STENCIL_BIT_16))
953 { 963 {
954 stencil = 1 << ((int) cfg->stencil_bits - 1); 964 stencil = 1 << ((int) cfg->stencil_bits - 1);
955 config_attrs[i++] = EGL_STENCIL_SIZE; 965 config_attrs[i++] = EGL_STENCIL_SIZE;
956 config_attrs[i++] = stencil; 966 config_attrs[i++] = stencil;
957 DBG("Requesting stencil buffer size %d", stencil); 967 DBG("Requesting stencil buffer size %d", stencil);
958 } 968 }
959 if ((cfg->multisample_bits > EVAS_GL_MULTISAMPLE_NONE) && 969 if (msaa)
960 (cfg->multisample_bits <= EVAS_GL_MULTISAMPLE_HIGH))
961 { 970 {
962 msaa = evgl->caps.msaa_samples[(int) cfg->multisample_bits - 1]; 971 msaa = evgl->caps.msaa_samples[(int) cfg->multisample_bits - 1];
963 config_attrs[i++] = EGL_SAMPLE_BUFFERS; 972 config_attrs[i++] = EGL_SAMPLE_BUFFERS;
@@ -978,6 +987,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
978 return NULL; 987 return NULL;
979 } 988 }
980 989
990 DBG("Found %d potential configurations", num);
981 for (i = 0; (i < num) && !found; i++) 991 for (i = 0; (i < num) && !found; i++)
982 { 992 {
983 EGLint val = 0; 993 EGLint val = 0;
@@ -1003,6 +1013,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
1003 { 1013 {
1004 if (xvi[j].depth >= colordepth) 1014 if (xvi[j].depth >= colordepth)
1005 { 1015 {
1016 if (!best) best = i;
1006 if (alpha) 1017 if (alpha)
1007 { 1018 {
1008 fmt = XRenderFindVisualFormat(eng_get_ob(re)->disp, xvi[j].visual); 1019 fmt = XRenderFindVisualFormat(eng_get_ob(re)->disp, xvi[j].visual);
@@ -1026,9 +1037,9 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
1026 if (!found) 1037 if (!found)
1027 { 1038 {
1028 // This config will probably not work, but we try anyways. 1039 // This config will probably not work, but we try anyways.
1029 ERR("XGetVisualInfo failed. Trying with the first EGL config."); 1040 ERR("XGetVisualInfo failed. Trying with EGL config #%d", best);
1030 if (num) 1041 if (num)
1031 egl_cfg = configs[0]; 1042 egl_cfg = configs[best];
1032 else 1043 else
1033 egl_cfg = eng_get_ob(re)->egl_config; 1044 egl_cfg = eng_get_ob(re)->egl_config;
1034 } 1045 }