From: Stanislav Vorobiov Date: Fri, 6 Dec 2013 10:42:28 +0000 (+0400) Subject: evas/wayland_egl: Use packed_depth_stencil when possible X-Git-Tag: submit/tizen/20131218.020707~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef91a563d8c8742026a7268ec1b008eb38ebd31c;p=platform%2Fupstream%2Fevas.git evas/wayland_egl: Use packed_depth_stencil when possible According to OpenGL standard, 9.4.3 Required Framebuffer Formats: "However, when both depth and stencil attachments are present, implementations are only required to support framebuffer objects where both attachments refer to the same image." So use packed_depth_stencil when it's possible Change-Id: I92c4e0bb70e87bbfa69e65b5ece719c90d07f316 Signed-off-by: Stanislav Vorobiov --- diff --git a/src/modules/engines/wayland_egl/evas_engine.c b/src/modules/engines/wayland_egl/evas_engine.c index c32223e..3bed4ed 100644 --- a/src/modules/engines/wayland_egl/evas_engine.c +++ b/src/modules/engines/wayland_egl/evas_engine.c @@ -2109,7 +2109,7 @@ eng_canvas_alpha_get(void *data, void *info __UNUSED__) } static int -_set_internal_config(Render_Engine_GL_Surface *sfc, Evas_GL_Config *cfg) +_set_internal_config(Render_Engine *re, Render_Engine_GL_Surface *sfc, Evas_GL_Config *cfg) { // Also initialize pixel format here as well... switch(cfg->color_format) @@ -2151,7 +2151,17 @@ _set_internal_config(Render_Engine_GL_Surface *sfc, Evas_GL_Config *cfg) case EVAS_GL_STENCIL_BIT_2: case EVAS_GL_STENCIL_BIT_4: case EVAS_GL_STENCIL_BIT_8: - sfc->rb_stencil_fmt = GL_STENCIL_INDEX8; + if ((cfg->depth_bits != EVAS_GL_DEPTH_NONE) && + re->gl_cap.depth_24_stencil_8[0]) + { + sfc->rb_depth_stencil_fmt = re->gl_cap.depth_24_stencil_8[0]; + sfc->rb_depth_fmt = re->gl_cap.depth_24_stencil_8[0]; + sfc->rb_stencil_fmt = re->gl_cap.depth_24_stencil_8[0]; + } + else + { + sfc->rb_stencil_fmt = GL_STENCIL_INDEX8; + } break; case EVAS_GL_STENCIL_BIT_16: default: @@ -2159,8 +2169,6 @@ _set_internal_config(Render_Engine_GL_Surface *sfc, Evas_GL_Config *cfg) return 0; } - // Do Packed Depth24_Stencil8 Later... - return 1; } @@ -2595,7 +2603,7 @@ eng_gl_surface_create(void *data, void *config, int w, int h) } // Set the internal format based on the config - if (!_set_internal_config(sfc, cfg)) + if (!_set_internal_config(re, sfc, cfg)) { ERR("Unsupported Format!"); goto finish;