EvasGL: Adding MSAA for depth_24_stencil_8 format that was missing
authorsung <sung@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 28 Jun 2012 03:37:13 +0000 (03:37 +0000)
committersung <sung@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 28 Jun 2012 03:37:13 +0000 (03:37 +0000)
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

index 55cd7b2..9fa5dcb 100644 (file)
@@ -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