[gtk/wip/chergert/glproto: 517/526] actually use stamp to compare




commit 702ebb2f848a686111215a76d2cb27cca4cf0088
Author: Christian Hergert <chergert redhat com>
Date:   Fri Feb 12 15:07:00 2021 -0800

    actually use stamp to compare

 gsk/next/gskgluniformstateprivate.h | 40 +++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 19 deletions(-)
---
diff --git a/gsk/next/gskgluniformstateprivate.h b/gsk/next/gskgluniformstateprivate.h
index 9024db908a..1de9afea22 100644
--- a/gsk/next/gskgluniformstateprivate.h
+++ b/gsk/next/gskgluniformstateprivate.h
@@ -254,8 +254,11 @@ gsk_gl_uniform_state_realloc (GskGLUniformState *state,
 static inline void
 gsk_gl_uniform_program_changed (GskGLUniformProgram     *program,
                                 GskGLUniformInfoElement *info,
-                                guint                    location)
+                                guint                    location,
+                                guint                    stamp)
 {
+  info->stamp = stamp;
+
   if (info->info.changed == FALSE)
     {
       info->info.changed = TRUE;
@@ -265,7 +268,6 @@ gsk_gl_uniform_program_changed (GskGLUniformProgram     *program,
     }
 }
 
-
 static inline void
 gsk_gl_uniform_state_set1f (GskGLUniformState   *state,
                             GskGLUniformProgram *program,
@@ -285,7 +287,7 @@ gsk_gl_uniform_state_set1f (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform1f , 1);
           u->v0 = value0;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -311,7 +313,7 @@ gsk_gl_uniform_state_set2f (GskGLUniformState   *state,
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform2f, 1);
           u->v0 = value0;
           u->v1 = value1;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -339,7 +341,7 @@ gsk_gl_uniform_state_set3f (GskGLUniformState   *state,
           u->v0 = value0;
           u->v1 = value1;
           u->v2 = value2;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -369,7 +371,7 @@ gsk_gl_uniform_state_set4f (GskGLUniformState   *state,
           u->v1 = value1;
           u->v2 = value2;
           u->v3 = value3;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -393,7 +395,7 @@ gsk_gl_uniform_state_set1ui (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform1ui, 1);
           u->v0 = value0;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -417,7 +419,7 @@ gsk_gl_uniform_state_set1i (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform1i, 1);
           u->v0 = value0;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -443,7 +445,7 @@ gsk_gl_uniform_state_set2i (GskGLUniformState   *state,
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform2i, 1);
           u->v0 = value0;
           u->v1 = value1;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -471,7 +473,7 @@ gsk_gl_uniform_state_set3i (GskGLUniformState   *state,
           u->v0 = value0;
           u->v1 = value1;
           u->v2 = value2;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -501,7 +503,7 @@ gsk_gl_uniform_state_set4i (GskGLUniformState   *state,
           u->v1 = value1;
           u->v2 = value2;
           u->v3 = value3;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -554,7 +556,7 @@ gsk_gl_uniform_state_set_rounded_rect (GskGLUniformState    *state,
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, GskRoundedRect, 1);
 
           memcpy (u, rounded_rect, sizeof *rounded_rect);
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -580,7 +582,7 @@ gsk_gl_uniform_state_set_matrix (GskGLUniformState       *state,
 
       GSK_GL_UNIFORM_STATE_REPLACE (info, u, graphene_matrix_t, 1);
       memcpy (u, matrix, sizeof *matrix);
-      gsk_gl_uniform_program_changed (program, info, location);
+      gsk_gl_uniform_program_changed (program, info, location, stamp);
     }
 }
 
@@ -619,7 +621,7 @@ gsk_gl_uniform_state_set_texture (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, guint, 1);
           *u = texture_slot;
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -658,7 +660,7 @@ gsk_gl_uniform_state_set_color (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, GdkRGBA, 1);
           memcpy (u, color, sizeof *color);
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -686,7 +688,7 @@ gsk_gl_uniform_state_set1fv (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform1f, count);
           memcpy (u, value, sizeof (Uniform1f) * count);
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -714,7 +716,7 @@ gsk_gl_uniform_state_set2fv (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform2f, count);
           memcpy (u, value, sizeof (Uniform2f) * count);
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -742,7 +744,7 @@ gsk_gl_uniform_state_set3fv (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform3f, count);
           memcpy (u, value, sizeof (Uniform3f) * count);
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }
@@ -770,7 +772,7 @@ gsk_gl_uniform_state_set4fv (GskGLUniformState   *state,
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, Uniform4f, count);
           memcpy (u, value, sizeof (Uniform4f) * count);
-          gsk_gl_uniform_program_changed (program, info, location);
+          gsk_gl_uniform_program_changed (program, info, location, stamp);
         }
     }
 }


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