[gtk/wip/chergert/glproto: 66/493] change program for draw batches




commit c63b6047b4bc2f62c5cd2829cd550c83d2f72681
Author: Christian Hergert <chergert redhat com>
Date:   Mon Dec 28 09:17:06 2020 -0800

    change program for draw batches

 gsk/next/gskglcommandqueue.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index ce26d409a2..8c1cecf523 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -904,6 +904,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self)
   GLuint framebuffer = 0;
   GLuint vao_id;
   int next_batch_index;
+  guint program = 0;
   guint16 width = 0;
   guint16 height = 0;
 
@@ -974,6 +975,12 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self)
         break;
 
         case GSK_GL_COMMAND_KIND_DRAW:
+          if (batch->any.program != program)
+            {
+              program = batch->any.program;
+              glUseProgram (program);
+            }
+
           if (batch->draw.framebuffer != framebuffer)
             {
               framebuffer = batch->draw.framebuffer;


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