summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-05-05 09:42:54 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-05-05 12:05:10 -0400
commite9f5a3e9e26b2d26c17e670a95454c3af109b8fa (patch)
tree006f9a2637d88df9e3b156c4d83790844573d96a /gsk
parent2b85c49fb15040ce38db4385f2d046a5f6beeba4 (diff)
downloadgtk+-e9f5a3e9e26b2d26c17e670a95454c3af109b8fa.tar.gz
gsk: Introduce a constant
We need this number in a couple of places, so pull it out as a constant.
Diffstat (limited to 'gsk')
-rw-r--r--gsk/gl/gskglattachmentstateprivate.h6
-rw-r--r--gsk/gl/gskglcommandqueue.c4
2 files changed, 6 insertions, 4 deletions
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;