[gtk/wip/otte/win32-cleanup: 15/19] ngl: Turn off depth test




commit 4b697f21e0f6547340103203b668dd87da6bdd31
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/ngl/gsknglcommandqueue.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gsk/ngl/gsknglcommandqueue.c b/gsk/ngl/gsknglcommandqueue.c
index 217fce13a2..d500eaf402 100644
--- a/gsk/ngl/gsknglcommandqueue.c
+++ b/gsk/ngl/gsknglcommandqueue.c
@@ -978,8 +978,7 @@ 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);
+  glDisable (GL_DEPTH_TEST);
 
   /* Pre-multiplied alpha */
   glEnable (GL_BLEND);


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