1/* gskglattachmentstateprivate.h
2 *
3 * Copyright 2020 Christian Hergert <chergert@redhat.com>
4 *
5 * This file is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 2.1 of the License, or (at your option)
8 * any later version.
9 *
10 * This file is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13 * License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * SPDX-License-Identifier: LGPL-2.1-or-later
19 */
20
21#ifndef __GSK_GL_ATTACHMENT_STATE_PRIVATE_H__
22#define __GSK_GL_ATTACHMENT_STATE_PRIVATE_H__
23
24#include "gskgltypesprivate.h"
25
26G_BEGIN_DECLS
27
28typedef struct _GskGLAttachmentState GskGLAttachmentState;
29typedef struct _GskGLBindFramebuffer GskGLBindFramebuffer;
30typedef struct _GskGLBindTexture GskGLBindTexture;
31
32struct _GskGLBindTexture
33{
34 guint changed : 1;
35 guint initial : 1;
36 GLenum target : 30;
37 GLenum texture;
38 guint id;
39};
40
41G_STATIC_ASSERT (sizeof (GskGLBindTexture) == 12);
42
43struct _GskGLBindFramebuffer
44{
45 guint changed : 1;
46 guint id : 31;
47};
48
49G_STATIC_ASSERT (sizeof (GskGLBindFramebuffer) == 4);
50
51struct _GskGLAttachmentState
52{
53 GskGLBindFramebuffer fbo;
54 /* Increase if shaders add more textures */
55 GskGLBindTexture textures[4];
56 guint n_changed;
57};
58
59GskGLAttachmentState *gsk_gl_attachment_state_new (void);
60GskGLAttachmentState *gsk_gl_attachment_state_ref (GskGLAttachmentState *self);
61void gsk_gl_attachment_state_unref (GskGLAttachmentState *self);
62void gsk_gl_attachment_state_bind_texture (GskGLAttachmentState *self,
63 GLenum target,
64 GLenum texture,
65 guint id);
66void gsk_gl_attachment_state_bind_framebuffer (GskGLAttachmentState *self,
67 guint id);
68
69G_END_DECLS
70
71#endif /* __GSK_GL_ATTACHMENT_STATE_PRIVATE_H__ */
72

source code of gtk/gsk/gl/gskglattachmentstateprivate.h