gsk: Introduce a constant
authorMatthias Clasen <mclasen@redhat.com>
Fri, 5 May 2023 13:42:54 +0000 (09:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 5 May 2023 16:05:10 +0000 (12:05 -0400)
We need this number in a couple of places,
so pull it out as a constant.

gsk/gl/gskglattachmentstateprivate.h
gsk/gl/gskglcommandqueue.c

index 67141b045225cbcadab70ebfdc36de49821e7f29..f65d7641a90947532a7d700f618da95ce0da4abc 100644 (file)
@@ -73,11 +73,13 @@ struct _GskGLBindFramebuffer
 
 G_STATIC_ASSERT (sizeof (GskGLBindFramebuffer) == 4);
 
+/* Increase if shaders add more textures */
+#define GSK_GL_MAX_TEXTURES_PER_PROGRAM 4
+
 struct _GskGLAttachmentState
 {
   GskGLBindFramebuffer fbo;
-  /* Increase if shaders add more textures */
-  GskGLBindTexture textures[4];
+  GskGLBindTexture textures[GSK_GL_MAX_TEXTURES_PER_PROGRAM];
   guint n_changed;
 };
 
index 50c9c3908cd2dfa4015ce48542dc6f526e1e139f..30e3c83ba55100db7d1e9bb82997cda1089fef53 100644 (file)
@@ -1028,8 +1028,8 @@ gsk_gl_command_queue_execute (GskGLCommandQueue    *self,
   G_GNUC_UNUSED unsigned int n_programs = 0;
   guint vao_id;
   guint vbo_id;
-  int textures[4];
-  int samplers[4];
+  int textures[GSK_GL_MAX_TEXTURES_PER_PROGRAM];
+  int samplers[GSK_GL_MAX_TEXTURES_PER_PROGRAM];
   int framebuffer = -1;
   int next_batch_index;
   int active = -1;