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 | |
26 | G_BEGIN_DECLS |
27 | |
28 | typedef struct _GskGLAttachmentState GskGLAttachmentState; |
29 | typedef struct _GskGLBindFramebuffer GskGLBindFramebuffer; |
30 | typedef struct _GskGLBindTexture GskGLBindTexture; |
31 | |
32 | struct _GskGLBindTexture |
33 | { |
34 | guint changed : 1; |
35 | guint initial : 1; |
36 | GLenum target : 30; |
37 | GLenum texture; |
38 | guint id; |
39 | }; |
40 | |
41 | G_STATIC_ASSERT (sizeof (GskGLBindTexture) == 12); |
42 | |
43 | struct _GskGLBindFramebuffer |
44 | { |
45 | guint changed : 1; |
46 | guint id : 31; |
47 | }; |
48 | |
49 | G_STATIC_ASSERT (sizeof (GskGLBindFramebuffer) == 4); |
50 | |
51 | struct _GskGLAttachmentState |
52 | { |
53 | GskGLBindFramebuffer fbo; |
54 | /* Increase if shaders add more textures */ |
55 | GskGLBindTexture textures[4]; |
56 | guint n_changed; |
57 | }; |
58 | |
59 | GskGLAttachmentState *gsk_gl_attachment_state_new (void); |
60 | GskGLAttachmentState *gsk_gl_attachment_state_ref (GskGLAttachmentState *self); |
61 | void gsk_gl_attachment_state_unref (GskGLAttachmentState *self); |
62 | void gsk_gl_attachment_state_bind_texture (GskGLAttachmentState *self, |
63 | GLenum target, |
64 | GLenum texture, |
65 | guint id); |
66 | void gsk_gl_attachment_state_bind_framebuffer (GskGLAttachmentState *self, |
67 | guint id); |
68 | |
69 | G_END_DECLS |
70 | |
71 | #endif /* __GSK_GL_ATTACHMENT_STATE_PRIVATE_H__ */ |
72 |