[gtk/wip/otte/win32-cleanup: 1/5] ngl: Turn off depth test




commit efbad0baa0dbcd8f54b302f28f1f39a37a5285ed
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jul 29 06:17:04 2021 +0200

    ngl: Turn off depth test
    
    Usually, the GdkGLContext will have the depth buffer disabled, so the
    depth test will not work. However, if the GDK backend does not provide a
    config without depth buffer, there will be one.
    
    And if we enable it, it'll do the wrong thing.
    
    For example, it'll paint the wrong thing in the cube flip animation of
    GtkStack (like on widget-factory page 2).

 gsk/gl/gskglrenderer.c       | 3 ---
 gsk/ngl/gsknglcommandqueue.c | 3 ---
 2 files changed, 6 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index a801f55ab3..f695773ce2 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -4289,9 +4289,6 @@ gsk_gl_renderer_do_render (GskRenderer           *renderer,
   gsk_gl_renderer_setup_render_mode (self);
   gsk_gl_renderer_clear (self);
 
-  glEnable (GL_DEPTH_TEST);
-  glDepthFunc (GL_LEQUAL);
-
   /* Pre-multiplied alpha! */
   glEnable (GL_BLEND);
   glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/gsk/ngl/gsknglcommandqueue.c b/gsk/ngl/gsknglcommandqueue.c
index 217fce13a2..f6296e374a 100644
--- a/gsk/ngl/gsknglcommandqueue.c
+++ b/gsk/ngl/gsknglcommandqueue.c
@@ -978,9 +978,6 @@ gsk_ngl_command_queue_execute (GskNglCommandQueue   *self,
   gsk_profiler_timer_begin (self->profiler, self->metrics.cpu_time);
 #endif
 
-  glEnable (GL_DEPTH_TEST);
-  glDepthFunc (GL_LEQUAL);
-
   /* Pre-multiplied alpha */
   glEnable (GL_BLEND);
   glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]