From: Matthias Clasen Date: Fri, 5 May 2023 13:42:54 +0000 (-0400) Subject: gsk: Introduce a constant X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~307^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e9f5a3e9e26b2d26c17e670a95454c3af109b8fa;p=gtk4.git gsk: Introduce a constant We need this number in a couple of places, so pull it out as a constant. --- diff --git a/gsk/gl/gskglattachmentstateprivate.h b/gsk/gl/gskglattachmentstateprivate.h index 67141b0452..f65d7641a9 100644 --- a/gsk/gl/gskglattachmentstateprivate.h +++ b/gsk/gl/gskglattachmentstateprivate.h @@ -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; }; diff --git a/gsk/gl/gskglcommandqueue.c b/gsk/gl/gskglcommandqueue.c index 50c9c3908c..30e3c83ba5 100644 --- a/gsk/gl/gskglcommandqueue.c +++ b/gsk/gl/gskglcommandqueue.c @@ -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;