aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/mutter-fix-inverted-test.patch
blob: 3676b31deff3ca43b7e849f5089563bd31a70d77 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
From 5a83e8ef8250526a40e8e69c6398f990ab482b2f Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 2 Jun 2023 14:42:51 +0200
Subject: [PATCH 1/5] cogl/gl-framebuffer: Fix spurious trailing spaces

Purely cosmetic fix, no functional change.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3047>
---
 cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c | 12 ++++++------
 cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c  | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
index d6609bb2074..8d76f1578bf 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
@@ -72,32 +72,32 @@ ensure_bits_initialized (CoglGlFramebufferBack *gl_framebuffer_back)
         GLenum attachment, pname;
         size_t offset;
       } params[] = {
-        { 
+        {
           .attachment = GL_BACK_LEFT,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE,
           .offset = offsetof (CoglFramebufferBits, red),
         },
-        { 
+        {
           .attachment = GL_BACK_LEFT,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
           .offset = offsetof (CoglFramebufferBits, green),
         },
-        { 
+        {
           .attachment = GL_BACK_LEFT,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
           .offset = offsetof (CoglFramebufferBits, blue),
         },
-        { 
+        {
           .attachment = GL_BACK_LEFT,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
           .offset = offsetof (CoglFramebufferBits, alpha),
         },
-        { 
+        {
           .attachment = GL_DEPTH,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
           .offset = offsetof (CoglFramebufferBits, depth),
         },
-        { 
+        {
           .attachment = GL_STENCIL,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
           .offset = offsetof (CoglFramebufferBits, stencil),
diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
index c8db6a23a29..1ffc1d53509 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
@@ -82,32 +82,32 @@ ensure_bits_initialized (CoglGlFramebufferFbo *gl_framebuffer_fbo)
         GLenum attachment, pname;
         size_t offset;
       } params[] = {
-        { 
+        {
           .attachment = GL_COLOR_ATTACHMENT0,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE,
           .offset = offsetof (CoglFramebufferBits, red),
         },
-        { 
+        {
           .attachment = GL_COLOR_ATTACHMENT0,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
           .offset = offsetof (CoglFramebufferBits, green),
         },
-        { 
+        {
           .attachment = GL_COLOR_ATTACHMENT0,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
           .offset = offsetof (CoglFramebufferBits, blue),
         },
-        { 
+        {
           .attachment = GL_COLOR_ATTACHMENT0,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
           .offset = offsetof (CoglFramebufferBits, alpha),
         },
-        { 
+        {
           .attachment = GL_DEPTH_ATTACHMENT,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
           .offset = offsetof (CoglFramebufferBits, depth),
         },
-        { 
+        {
           .attachment = GL_STENCIL_ATTACHMENT,
           .pname = GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
           .offset = offsetof (CoglFramebufferBits, stencil),
-- 
GitLab


From a2203df9f43b9e501a972d23b3d5584005c03ce6 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 2 Jun 2023 11:54:58 +0200
Subject: [PATCH 2/5] cogl/gl-framebuffer: Fix inverted test in
 ensure_bits_initialized()

Cogl's feature COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS is required
to use the GL_FRAMEBUFFER_ATTACHMENT_* queries.

Unfortunately, the test for the availability of the private feature is
actually inverted in ensure_bits_initialized() which causes that whole
portion of code to be ignored, falling back to the glGetIntegerv()
method which isn't supported in core profiles.

As Mesa has recently started to be more strict about these, this causes
the CI tests to fail in mutter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3047>
---
 cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
index 1ffc1d53509..75a8b0c1fe2 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
@@ -76,7 +76,7 @@ ensure_bits_initialized (CoglGlFramebufferFbo *gl_framebuffer_fbo)
                                         COGL_FRAMEBUFFER_STATE_BIND);
 
 #ifdef HAVE_COGL_GL
-  if (!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS))
+  if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS))
     {
       const struct {
         GLenum attachment, pname;
-- 
GitLab


From fad240f437d6b11f664c9c09aecabe5f5e703eca Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 5 Jun 2023 10:31:38 +0200
Subject: [PATCH 3/5] cogl/gl-framebuffer: Match testing features

The function ensure_bits_initialized() in cogl-gl-framebuffer-fbo.c
checks for COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS whereas the same
in cogl-gl-framebuffer-back.c simply checks for the driver being
COGL_DRIVER_GL3.

Change the later to use the COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS
flag as well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3047>
---
 cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
index 8d76f1578bf..f6a17e8f070 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
@@ -66,7 +66,7 @@ ensure_bits_initialized (CoglGlFramebufferBack *gl_framebuffer_back)
                                         COGL_FRAMEBUFFER_STATE_BIND);
 
 #ifdef HAVE_COGL_GL
-  if (ctx->driver == COGL_DRIVER_GL3)
+  if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS))
     {
       const struct {
         GLenum attachment, pname;
-- 
GitLab


From c3af4c1b1571b05f67d48b90d9ea7313f3ca6003 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 2 Jun 2023 14:27:29 +0200
Subject: [PATCH 4/5] cogl/gl-framebuffer: Fail without QUERY_FRAMEBUFFER_BITS

glGetIntegerv() with GL_RED_BITS/GL_GREEN_BITS/GL_BLUE_BITS/etc. is not
supported with the GL core context, so there is no point in falling back
to that without supporting COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS,
as this will cause an GL error.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3047>
---
 cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c | 7 +------
 cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c  | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
index f6a17e8f070..0ccd2324077 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
@@ -119,12 +119,7 @@ ensure_bits_initialized (CoglGlFramebufferBack *gl_framebuffer_back)
   else
 #endif /* HAVE_COGL_GL */
     {
-      GE (ctx, glGetIntegerv (GL_RED_BITS, &bits->red));
-      GE (ctx, glGetIntegerv (GL_GREEN_BITS, &bits->green));
-      GE (ctx, glGetIntegerv (GL_BLUE_BITS, &bits->blue));
-      GE (ctx, glGetIntegerv (GL_ALPHA_BITS, &bits->alpha));
-      GE (ctx, glGetIntegerv (GL_DEPTH_BITS, &bits->depth));
-      GE (ctx, glGetIntegerv (GL_STENCIL_BITS, &bits->stencil));
+      return FALSE;
     }
 
   COGL_NOTE (FRAMEBUFFER,
diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
index 75a8b0c1fe2..524196207f5 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
@@ -129,12 +129,7 @@ ensure_bits_initialized (CoglGlFramebufferFbo *gl_framebuffer_fbo)
   else
 #endif /* HAVE_COGL_GL */
     {
-      GE (ctx, glGetIntegerv (GL_RED_BITS, &bits->red));
-      GE (ctx, glGetIntegerv (GL_GREEN_BITS, &bits->green));
-      GE (ctx, glGetIntegerv (GL_BLUE_BITS, &bits->blue));
-      GE (ctx, glGetIntegerv (GL_ALPHA_BITS, &bits->alpha));
-      GE (ctx, glGetIntegerv (GL_DEPTH_BITS, &bits->depth));
-      GE (ctx, glGetIntegerv (GL_STENCIL_BITS, &bits->stencil));
+      return FALSE;
     }
 
   if (!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_ALPHA_TEXTURES) &&
-- 
GitLab


From d65883e0d7d70987e3888b86222b109c35f5a7a2 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 5 Jun 2023 10:38:41 +0200
Subject: [PATCH 5/5] cogl/gl-framebuffer: Remove conditional on HAVE_COGL_GL

By testing the features flag, we can get rid of the conditional build
on HAVE_COGL_GL entirely.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3047>
---
 cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c | 2 --
 cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c  | 2 --
 2 files changed, 4 deletions(-)

diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
index 0ccd2324077..94154d48efb 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-back.c
@@ -65,7 +65,6 @@ ensure_bits_initialized (CoglGlFramebufferBack *gl_framebuffer_back)
                                         framebuffer,
                                         COGL_FRAMEBUFFER_STATE_BIND);
 
-#ifdef HAVE_COGL_GL
   if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS))
     {
       const struct {
@@ -117,7 +116,6 @@ ensure_bits_initialized (CoglGlFramebufferBack *gl_framebuffer_back)
         }
     }
   else
-#endif /* HAVE_COGL_GL */
     {
       return FALSE;
     }
diff --git a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
index 524196207f5..3ea133d3143 100644
--- a/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
+++ b/cogl/cogl/driver/gl/cogl-gl-framebuffer-fbo.c
@@ -75,7 +75,6 @@ ensure_bits_initialized (CoglGlFramebufferFbo *gl_framebuffer_fbo)
                                         framebuffer,
                                         COGL_FRAMEBUFFER_STATE_BIND);
 
-#ifdef HAVE_COGL_GL
   if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS))
     {
       const struct {
@@ -127,7 +126,6 @@ ensure_bits_initialized (CoglGlFramebufferFbo *gl_framebuffer_fbo)
         }
     }
   else
-#endif /* HAVE_COGL_GL */
     {
       return FALSE;
     }
-- 
GitLab