From fc1c1ccde1d54b3adfeb052732259561d660532b Mon Sep 17 00:00:00 2001 From: sung Date: Thu, 28 Jun 2012 03:37:13 +0000 Subject: [PATCH] EvasGL: Adding MSAA for depth_24_stencil_8 format that was missing from the previous commit. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@72970 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/engines/gl_x11/evas_engine.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/modules/engines/gl_x11/evas_engine.c b/src/modules/engines/gl_x11/evas_engine.c index 55cd7b2..9fa5dcb 100644 --- a/src/modules/engines/gl_x11/evas_engine.c +++ b/src/modules/engines/gl_x11/evas_engine.c @@ -3367,7 +3367,10 @@ _attach_fbo_surface(Render_Engine *data __UNUSED__, // Attach texture to FBO if (sfc->rt_msaa_samples) - glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sfc->rt_tex, 0, sfc->rt_msaa_samples); + glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, sfc->rt_tex, + 0, sfc->rt_msaa_samples); else glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sfc->rt_tex, 0); @@ -3387,10 +3390,26 @@ _attach_fbo_surface(Render_Engine *data __UNUSED__, glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, sfc->w, sfc->h, 0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, - GL_TEXTURE_2D, sfc->rb_depth_stencil, 0); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, - GL_TEXTURE_2D, sfc->rb_depth_stencil, 0); + if (sfc->rt_msaa_samples) + { + glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, + GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, + sfc->rb_depth_stencil, + 0, sfc->rt_msaa_samples); + glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, + GL_STENCIL_ATTACHMENT, + GL_TEXTURE_2D, + sfc->rb_depth_stencil, + 0, sfc->rt_msaa_samples); + } + else + { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, sfc->rb_depth_stencil, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_TEXTURE_2D, sfc->rb_depth_stencil, 0); + } glBindTexture(GL_TEXTURE_2D, curr_tex); #else -- 2.7.4