summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-03-19 11:09:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-20 11:29:03 +0000
commite02e69fbe297fa0ca2db44f2eb37b9e95a8497d5 (patch)
treeb1c5ba411fe35d22bdc72270008dcb70538d721b /meta
parent8aa856a421280250b8c5b869ad4cf48bbc8107e6 (diff)
downloadpoky-e02e69fbe297fa0ca2db44f2eb37b9e95a8497d5.tar.gz
mesa-demos: update 8.5.0 -> 9.0.0
The new version is in a location that isn't discoverable by upstream version checks, and so has been overlooked for a while. Drop patches: 0001-mesa-demos-Add-missing-data-files.patch (backport) 0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch (very old patch rejected by upstream as not necessary and not making sense: https://gitlab.freedesktop.org/mesa/demos/-/issues/9 ) Disably wayland for now due to libdecor dependency, adjust other feature dependencies as needed. (From OE-Core rev: 59a9e96fa43e18af932cec7c2f1a36d9fcafff94) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch624
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch234
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb (renamed from meta/recipes-graphics/mesa/mesa-demos_8.5.0.bb)15
3 files changed, 8 insertions, 865 deletions
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
deleted file mode 100644
index 93ee9c286d..0000000000
--- a/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
+++ /dev/null
@@ -1,624 +0,0 @@
1From b695c3a3fa3f4cd48c13aa26542110de27075518 Mon Sep 17 00:00:00 2001
2From: Drew Moseley <drew_moseley@mentor.com>
3Date: Mon, 12 May 2014 15:22:32 -0400
4Subject: [PATCH 1/9] mesa-demos: Add missing data files.
5
6Add some data files that are present in the git repository:
7 http://cgit.freedesktop.org/mesa/demos/tree/?id=mesa-demos-8.1.0
8but not in the release tarball
9 ftp://ftp.freedesktop.org/pub/mesa/demos/8.1.0/mesa-demos-8.1.0.tar.bz2
10
11Upstream-Status: Backport
12Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
13Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14---
15 src/fpglsl/depth-read.glsl | 4 +
16 src/fpglsl/infinite-loop.glsl | 7 +
17 src/glsl/CH11-bumpmaptex.frag | 47 +++++++
18 src/glsl/blinking-teapot.frag | 31 +++++
19 src/glsl/blinking-teapot.vert | 16 +++
20 src/glsl/convolution.frag | 21 +++
21 src/glsl/simplex-noise.glsl | 279 ++++++++++++++++++++++++++++++++++++++++
22 src/glsl/skinning.vert | 24 ++++
23 src/perf/glslstateschange1.frag | 19 +++
24 src/perf/glslstateschange1.vert | 14 ++
25 src/perf/glslstateschange2.frag | 17 +++
26 src/perf/glslstateschange2.vert | 14 ++
27 src/vpglsl/infinite-loop.glsl | 8 ++
28 13 files changed, 501 insertions(+)
29 create mode 100644 src/fpglsl/depth-read.glsl
30 create mode 100644 src/fpglsl/infinite-loop.glsl
31 create mode 100644 src/glsl/CH11-bumpmaptex.frag
32 create mode 100644 src/glsl/blinking-teapot.frag
33 create mode 100644 src/glsl/blinking-teapot.vert
34 create mode 100644 src/glsl/convolution.frag
35 create mode 100644 src/glsl/simplex-noise.glsl
36 create mode 100644 src/glsl/skinning.vert
37 create mode 100644 src/perf/glslstateschange1.frag
38 create mode 100644 src/perf/glslstateschange1.vert
39 create mode 100644 src/perf/glslstateschange2.frag
40 create mode 100644 src/perf/glslstateschange2.vert
41 create mode 100644 src/vpglsl/infinite-loop.glsl
42
43diff --git a/src/fpglsl/depth-read.glsl b/src/fpglsl/depth-read.glsl
44new file mode 100644
45index 0000000..86d298e
46--- /dev/null
47+++ b/src/fpglsl/depth-read.glsl
48@@ -0,0 +1,4 @@
49+void main()
50+{
51+ gl_FragColor = gl_FragCoord.zzzz;
52+}
53diff --git a/src/fpglsl/infinite-loop.glsl b/src/fpglsl/infinite-loop.glsl
54new file mode 100644
55index 0000000..c6dc6ee
56--- /dev/null
57+++ b/src/fpglsl/infinite-loop.glsl
58@@ -0,0 +1,7 @@
59+void main() {
60+ vec4 sum = vec4(0);
61+ for (int i = 1; i != 2; i += 2) {
62+ sum += vec4(0.1, 0.1, 0.1, 0.1);
63+ }
64+ gl_FragColor = sum;
65+}
66diff --git a/src/glsl/CH11-bumpmaptex.frag b/src/glsl/CH11-bumpmaptex.frag
67new file mode 100644
68index 0000000..b5dabb4
69--- /dev/null
70+++ b/src/glsl/CH11-bumpmaptex.frag
71@@ -0,0 +1,47 @@
72+//
73+// Fragment shader for procedural bumps
74+//
75+// Authors: John Kessenich, Randi Rost
76+//
77+// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
78+//
79+// See 3Dlabs-License.txt for license information
80+//
81+// Texture mapping/modulation added by Brian Paul
82+//
83+
84+varying vec3 LightDir;
85+varying vec3 EyeDir;
86+
87+uniform float BumpDensity; // = 16.0
88+uniform float BumpSize; // = 0.15
89+uniform float SpecularFactor; // = 0.5
90+
91+uniform sampler2D Tex;
92+
93+void main()
94+{
95+ vec3 ambient = vec3(0.25);
96+ vec3 litColor;
97+ vec2 c = BumpDensity * gl_TexCoord[0].st;
98+ vec2 p = fract(c) - vec2(0.5);
99+
100+ float d, f;
101+ d = p.x * p.x + p.y * p.y;
102+ f = inversesqrt(d + 1.0);
103+
104+ if (d >= BumpSize)
105+ { p = vec2(0.0); f = 1.0; }
106+
107+ vec3 SurfaceColor = texture2D(Tex, gl_TexCoord[0].st).xyz;
108+
109+ vec3 normDelta = vec3(p.x, p.y, 1.0) * f;
110+ litColor = SurfaceColor * (ambient + max(dot(normDelta, LightDir), 0.0));
111+ vec3 reflectDir = reflect(LightDir, normDelta);
112+
113+ float spec = max(dot(EyeDir, reflectDir), 0.0);
114+ spec *= SpecularFactor;
115+ litColor = min(litColor + spec, vec3(1.0));
116+
117+ gl_FragColor = vec4(litColor, 1.0);
118+}
119diff --git a/src/glsl/blinking-teapot.frag b/src/glsl/blinking-teapot.frag
120new file mode 100644
121index 0000000..0db060b
122--- /dev/null
123+++ b/src/glsl/blinking-teapot.frag
124@@ -0,0 +1,31 @@
125+#extension GL_ARB_uniform_buffer_object : enable
126+
127+layout(std140) uniform colors0
128+{
129+ float DiffuseCool;
130+ float DiffuseWarm;
131+ vec3 SurfaceColor;
132+ vec3 WarmColor;
133+ vec3 CoolColor;
134+ vec4 some[8];
135+};
136+
137+varying float NdotL;
138+varying vec3 ReflectVec;
139+varying vec3 ViewVec;
140+
141+void main (void)
142+{
143+
144+ vec3 kcool = min(CoolColor + DiffuseCool * SurfaceColor, 1.0);
145+ vec3 kwarm = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0);
146+ vec3 kfinal = mix(kcool, kwarm, NdotL);
147+
148+ vec3 nreflect = normalize(ReflectVec);
149+ vec3 nview = normalize(ViewVec);
150+
151+ float spec = max(dot(nreflect, nview), 0.0);
152+ spec = pow(spec, 32.0);
153+
154+ gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0);
155+}
156diff --git a/src/glsl/blinking-teapot.vert b/src/glsl/blinking-teapot.vert
157new file mode 100644
158index 0000000..397d733
159--- /dev/null
160+++ b/src/glsl/blinking-teapot.vert
161@@ -0,0 +1,16 @@
162+vec3 LightPosition = vec3(0.0, 10.0, 4.0);
163+
164+varying float NdotL;
165+varying vec3 ReflectVec;
166+varying vec3 ViewVec;
167+
168+void main(void)
169+{
170+ vec3 ecPos = vec3 (gl_ModelViewMatrix * gl_Vertex);
171+ vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal);
172+ vec3 lightVec = normalize(LightPosition - ecPos);
173+ ReflectVec = normalize(reflect(-lightVec, tnorm));
174+ ViewVec = normalize(-ecPos);
175+ NdotL = (dot(lightVec, tnorm) + 1.0) * 0.5;
176+ gl_Position = ftransform();
177+}
178diff --git a/src/glsl/convolution.frag b/src/glsl/convolution.frag
179new file mode 100644
180index 0000000..e49b8ac
181--- /dev/null
182+++ b/src/glsl/convolution.frag
183@@ -0,0 +1,21 @@
184+
185+const int KernelSize = 9;
186+
187+//texture offsets
188+uniform vec2 Offset[KernelSize];
189+//convolution kernel
190+uniform vec4 KernelValue[KernelSize];
191+uniform sampler2D srcTex;
192+uniform vec4 ScaleFactor;
193+uniform vec4 BaseColor;
194+
195+void main(void)
196+{
197+ int i;
198+ vec4 sum = vec4(0.0);
199+ for (i = 0; i < KernelSize; ++i) {
200+ vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
201+ sum += tmp * KernelValue[i];
202+ }
203+ gl_FragColor = sum * ScaleFactor + BaseColor;
204+}
205diff --git a/src/glsl/simplex-noise.glsl b/src/glsl/simplex-noise.glsl
206new file mode 100644
207index 0000000..b6833cb
208--- /dev/null
209+++ b/src/glsl/simplex-noise.glsl
210@@ -0,0 +1,279 @@
211+//
212+// Description : Array and textureless GLSL 2D/3D/4D simplex
213+// noise functions.
214+// Author : Ian McEwan, Ashima Arts.
215+// Maintainer : ijm
216+// Lastmod : 20110223
217+// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
218+// Distributed under the Artistic License 2.0; See LICENCE file.
219+//
220+
221+#define NORMALIZE_GRADIENTS
222+#undef USE_CIRCLE
223+#define COLLAPSE_SORTNET
224+
225+float permute(float x0,vec3 p) {
226+ float x1 = mod(x0 * p.y, p.x);
227+ return floor( mod( (x1 + p.z) *x0, p.x ));
228+ }
229+vec2 permute(vec2 x0,vec3 p) {
230+ vec2 x1 = mod(x0 * p.y, p.x);
231+ return floor( mod( (x1 + p.z) *x0, p.x ));
232+ }
233+vec3 permute(vec3 x0,vec3 p) {
234+ vec3 x1 = mod(x0 * p.y, p.x);
235+ return floor( mod( (x1 + p.z) *x0, p.x ));
236+ }
237+vec4 permute(vec4 x0,vec3 p) {
238+ vec4 x1 = mod(x0 * p.y, p.x);
239+ return floor( mod( (x1 + p.z) *x0, p.x ));
240+ }
241+
242+uniform vec4 pParam;
243+// Example
244+// const vec4 pParam = vec4( 17.* 17., 34., 1., 7.);
245+
246+float taylorInvSqrt(float r)
247+ {
248+ return ( 0.83666002653408 + 0.7*0.85373472095314 - 0.85373472095314 * r );
249+ }
250+
251+float simplexNoise2(vec2 v)
252+ {
253+ const vec2 C = vec2(0.211324865405187134, // (3.0-sqrt(3.0))/6.;
254+ 0.366025403784438597); // 0.5*(sqrt(3.0)-1.);
255+ const vec3 D = vec3( 0., 0.5, 2.0) * 3.14159265358979312;
256+// First corner
257+ vec2 i = floor(v + dot(v, C.yy) );
258+ vec2 x0 = v - i + dot(i, C.xx);
259+
260+// Other corners
261+ vec2 i1 = (x0.x > x0.y) ? vec2(1.,0.) : vec2(0.,1.) ;
262+
263+ // x0 = x0 - 0. + 0. * C
264+ vec2 x1 = x0 - i1 + 1. * C.xx ;
265+ vec2 x2 = x0 - 1. + 2. * C.xx ;
266+
267+// Permutations
268+ i = mod(i, pParam.x);
269+ vec3 p = permute( permute(
270+ i.y + vec3(0., i1.y, 1. ), pParam.xyz)
271+ + i.x + vec3(0., i1.x, 1. ), pParam.xyz);
272+
273+#ifndef USE_CIRCLE
274+// ( N points uniformly over a line, mapped onto a diamond.)
275+ vec3 x = fract(p / pParam.w) ;
276+ vec3 h = 0.5 - abs(x) ;
277+
278+ vec3 sx = vec3(lessThan(x,D.xxx)) *2. -1.;
279+ vec3 sh = vec3(lessThan(h,D.xxx));
280+
281+ vec3 a0 = x + sx*sh;
282+ vec2 p0 = vec2(a0.x,h.x);
283+ vec2 p1 = vec2(a0.y,h.y);
284+ vec2 p2 = vec2(a0.z,h.z);
285+
286+#ifdef NORMALISE_GRADIENTS
287+ p0 *= taylorInvSqrt(dot(p0,p0));
288+ p1 *= taylorInvSqrt(dot(p1,p1));
289+ p2 *= taylorInvSqrt(dot(p2,p2));
290+#endif
291+
292+ vec3 g = 2.0 * vec3( dot(p0, x0), dot(p1, x1), dot(p2, x2) );
293+#else
294+// N points around a unit circle.
295+ vec3 phi = D.z * mod(p,pParam.w) /pParam.w ;
296+ vec4 a0 = sin(phi.xxyy+D.xyxy);
297+ vec2 a1 = sin(phi.zz +D.xy);
298+ vec3 g = vec3( dot(a0.xy, x0), dot(a0.zw, x1), dot(a1.xy, x2) );
299+#endif
300+// mix
301+ vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
302+ m = m*m ;
303+ return 1.66666* 70.*dot(m*m, g);
304+ }
305+
306+float simplexNoise3(vec3 v)
307+ {
308+ const vec2 C = vec2(1./6. , 1./3. ) ;
309+ const vec4 D = vec4(0., 0.5, 1.0, 2.0);
310+
311+// First corner
312+ vec3 i = floor(v + dot(v, C.yyy) );
313+ vec3 x0 = v - i + dot(i, C.xxx) ;
314+
315+// Other corners
316+#ifdef COLLAPSE_SORTNET
317+ vec3 g = vec3( greaterThan( x0.xyz, x0.yzx) );
318+ vec3 l = vec3( lessThanEqual( x0.xyz, x0.yzx) );
319+
320+ vec3 i1 = g.xyz * l.zxy;
321+ vec3 i2 = max( g.xyz, l.zxy);
322+#else
323+// Keeping this clean - let the compiler optimize.
324+ vec3 q1;
325+ q1.x = max(x0.x, x0.y);
326+ q1.y = min(x0.x, x0.y);
327+ q1.z = x0.z;
328+
329+ vec3 q2;
330+ q2.x = max(q1.x,q1.z);
331+ q2.z = min(q1.x,q1.z);
332+ q2.y = q1.y;
333+
334+ vec3 q3;
335+ q3.y = max(q2.y, q2.z);
336+ q3.z = min(q2.y, q2.z);
337+ q3.x = q2.x;
338+
339+ vec3 i1 = vec3(equal(q3.xxx, x0));
340+ vec3 i2 = i1 + vec3(equal(q3.yyy, x0));
341+#endif
342+
343+ // x0 = x0 - 0. + 0. * C
344+ vec3 x1 = x0 - i1 + 1. * C.xxx;
345+ vec3 x2 = x0 - i2 + 2. * C.xxx;
346+ vec3 x3 = x0 - 1. + 3. * C.xxx;
347+
348+// Permutations
349+ i = mod(i, pParam.x );
350+ vec4 p = permute( permute( permute(
351+ i.z + vec4(0., i1.z, i2.z, 1. ), pParam.xyz)
352+ + i.y + vec4(0., i1.y, i2.y, 1. ), pParam.xyz)
353+ + i.x + vec4(0., i1.x, i2.x, 1. ), pParam.xyz);
354+
355+// Gradients
356+// ( N*N points uniformly over a square, mapped onto a octohedron.)
357+ float n_ = 1.0/pParam.w ;
358+ vec3 ns = n_ * D.wyz - D.xzx ;
359+
360+ vec4 j = p - pParam.w*pParam.w*floor(p * ns.z *ns.z); // mod(p,N*N)
361+
362+ vec4 x_ = floor(j * ns.z) ;
363+ vec4 y_ = floor(j - pParam.w * x_ ) ; // mod(j,N)
364+
365+ vec4 x = x_ *ns.x + ns.yyyy;
366+ vec4 y = y_ *ns.x + ns.yyyy;
367+ vec4 h = 1. - abs(x) - abs(y);
368+
369+ vec4 b0 = vec4( x.xy, y.xy );
370+ vec4 b1 = vec4( x.zw, y.zw );
371+
372+ vec4 s0 = vec4(lessThan(b0,D.xxxx)) *2. -1.;
373+ vec4 s1 = vec4(lessThan(b1,D.xxxx)) *2. -1.;
374+ vec4 sh = vec4(lessThan(h, D.xxxx));
375+
376+ vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
377+ vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
378+
379+ vec3 p0 = vec3(a0.xy,h.x);
380+ vec3 p1 = vec3(a0.zw,h.y);
381+ vec3 p2 = vec3(a1.xy,h.z);
382+ vec3 p3 = vec3(a1.zw,h.w);
383+
384+#ifdef NORMALISE_GRADIENTS
385+ p0 *= taylorInvSqrt(dot(p0,p0));
386+ p1 *= taylorInvSqrt(dot(p1,p1));
387+ p2 *= taylorInvSqrt(dot(p2,p2));
388+ p3 *= taylorInvSqrt(dot(p3,p3));
389+#endif
390+
391+// Mix
392+ vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.);
393+ m = m * m;
394+//used to be 64.
395+ return 48.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
396+ dot(p2,x2), dot(p3,x3) ) );
397+ }
398+
399+vec4 grad4(float j, vec4 ip)
400+ {
401+ const vec4 ones = vec4(1.,1.,1.,-1.);
402+ vec4 p,s;
403+
404+ p.xyz = floor( fract (vec3(j) * ip.xyz) *pParam.w) * ip.z -1.0;
405+ p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
406+ s = vec4(lessThan(p,vec4(0.)));
407+ p.xyz = p.xyz + (s.xyz*2.-1.) * s.www;
408+
409+ return p;
410+ }
411+
412+float simplexNoise4(vec4 v)
413+ {
414+ const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4
415+ 0.309016994374947451); // (sqrt(5) - 1)/4 F4
416+// First corner
417+ vec4 i = floor(v + dot(v, C.yyyy) );
418+ vec4 x0 = v - i + dot(i, C.xxxx);
419+
420+// Other corners
421+
422+// Force existance of strict total ordering in sort.
423+ vec4 q0 = floor(x0 * 1024.0) + vec4( 0., 1./4., 2./4. , 3./4.);
424+ vec4 q1;
425+ q1.xy = max(q0.xy,q0.zw); // x:z y:w
426+ q1.zw = min(q0.xy,q0.zw);
427+
428+ vec4 q2;
429+ q2.xz = max(q1.xz,q1.yw); // x:y z:w
430+ q2.yw = min(q1.xz,q1.yw);
431+
432+ vec4 q3;
433+ q3.y = max(q2.y,q2.z); // y:z
434+ q3.z = min(q2.y,q2.z);
435+ q3.xw = q2.xw;
436+
437+ vec4 i1 = vec4(lessThanEqual(q3.xxxx, q0));
438+ vec4 i2 = vec4(lessThanEqual(q3.yyyy, q0));
439+ vec4 i3 = vec4(lessThanEqual(q3.zzzz, q0));
440+
441+ // x0 = x0 - 0. + 0. * C
442+ vec4 x1 = x0 - i1 + 1. * C.xxxx;
443+ vec4 x2 = x0 - i2 + 2. * C.xxxx;
444+ vec4 x3 = x0 - i3 + 3. * C.xxxx;
445+ vec4 x4 = x0 - 1. + 4. * C.xxxx;
446+
447+// Permutations
448+ i = mod(i, pParam.x );
449+ float j0 = permute( permute( permute( permute (
450+ i.w, pParam.xyz) + i.z, pParam.xyz)
451+ + i.y, pParam.xyz) + i.x, pParam.xyz);
452+ vec4 j1 = permute( permute( permute( permute (
453+ i.w + vec4(i1.w, i2.w, i3.w, 1. ), pParam.xyz)
454+ + i.z + vec4(i1.z, i2.z, i3.z, 1. ), pParam.xyz)
455+ + i.y + vec4(i1.y, i2.y, i3.y, 1. ), pParam.xyz)
456+ + i.x + vec4(i1.x, i2.x, i3.x, 1. ), pParam.xyz);
457+// Gradients
458+// ( N*N*N points uniformly over a cube, mapped onto a 4-octohedron.)
459+ vec4 ip = pParam ;
460+ ip.xy *= pParam.w ;
461+ ip.x *= pParam.w ;
462+ ip = vec4(1.,1.,1.,2.) / ip ;
463+
464+ vec4 p0 = grad4(j0, ip);
465+ vec4 p1 = grad4(j1.x, ip);
466+ vec4 p2 = grad4(j1.y, ip);
467+ vec4 p3 = grad4(j1.z, ip);
468+ vec4 p4 = grad4(j1.w, ip);
469+
470+#ifdef NORMALISE_GRADIENTS
471+ p0 *= taylorInvSqrt(dot(p0,p0));
472+ p1 *= taylorInvSqrt(dot(p1,p1));
473+ p2 *= taylorInvSqrt(dot(p2,p2));
474+ p3 *= taylorInvSqrt(dot(p3,p3));
475+ p4 *= taylorInvSqrt(dot(p4,p4));
476+#endif
477+
478+// Mix
479+ vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
480+ vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.);
481+ m0 = m0 * m0;
482+ m1 = m1 * m1;
483+ return 32. * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
484+ + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
485+
486+ }
487+
488+
489+
490diff --git a/src/glsl/skinning.vert b/src/glsl/skinning.vert
491new file mode 100644
492index 0000000..28970ee
493--- /dev/null
494+++ b/src/glsl/skinning.vert
495@@ -0,0 +1,24 @@
496+// Vertex weighting/blendin shader
497+// Brian Paul
498+// 4 Nov 2008
499+
500+uniform mat4 mat0, mat1;
501+attribute float weight;
502+
503+void main()
504+{
505+ // simple diffuse shading
506+ // Note that we should really transform the normal vector along with
507+ // the postion below... someday.
508+ vec3 lightVec = vec3(0, 0, 1);
509+ vec3 norm = gl_NormalMatrix * gl_Normal;
510+ float dot = 0.2 + max(0.0, dot(norm, lightVec));
511+ gl_FrontColor = vec4(dot);
512+
513+ // compute sum of weighted transformations
514+ vec4 pos0 = mat0 * gl_Vertex;
515+ vec4 pos1 = mat1 * gl_Vertex;
516+ vec4 pos = mix(pos0, pos1, weight);
517+
518+ gl_Position = gl_ModelViewProjectionMatrix * pos;
519+}
520diff --git a/src/perf/glslstateschange1.frag b/src/perf/glslstateschange1.frag
521new file mode 100644
522index 0000000..0839436
523--- /dev/null
524+++ b/src/perf/glslstateschange1.frag
525@@ -0,0 +1,19 @@
526+// Multi-texture fragment shader
527+// Brian Paul
528+
529+// Composite second texture over first.
530+// We're assuming the 2nd texture has a meaningful alpha channel.
531+
532+uniform sampler2D tex1;
533+uniform sampler2D tex2;
534+uniform vec4 UniV1;
535+uniform vec4 UniV2;
536+
537+void main()
538+{
539+ vec4 t3;
540+ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
541+ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
542+ t3 = mix(t1, t2, t2.w);
543+ gl_FragColor = t3 + UniV1 + UniV2;
544+}
545diff --git a/src/perf/glslstateschange1.vert b/src/perf/glslstateschange1.vert
546new file mode 100644
547index 0000000..cef50db
548--- /dev/null
549+++ b/src/perf/glslstateschange1.vert
550@@ -0,0 +1,14 @@
551+// Multi-texture vertex shader
552+// Brian Paul
553+
554+
555+attribute vec4 TexCoord0, TexCoord1;
556+attribute vec4 VertCoord;
557+
558+void main()
559+{
560+ gl_TexCoord[0] = TexCoord0;
561+ gl_TexCoord[1] = TexCoord1;
562+ // note: may use gl_Vertex or VertCoord here for testing:
563+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
564+}
565diff --git a/src/perf/glslstateschange2.frag b/src/perf/glslstateschange2.frag
566new file mode 100644
567index 0000000..0df0319
568--- /dev/null
569+++ b/src/perf/glslstateschange2.frag
570@@ -0,0 +1,17 @@
571+// Multi-texture fragment shader
572+// Brian Paul
573+
574+// Composite second texture over first.
575+// We're assuming the 2nd texture has a meaningful alpha channel.
576+
577+uniform sampler2D tex1;
578+uniform sampler2D tex2;
579+uniform vec4 UniV1;
580+uniform vec4 UniV2;
581+
582+void main()
583+{
584+ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
585+ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
586+ gl_FragColor = t1 + t2 + UniV1 + UniV2;
587+}
588diff --git a/src/perf/glslstateschange2.vert b/src/perf/glslstateschange2.vert
589new file mode 100644
590index 0000000..cef50db
591--- /dev/null
592+++ b/src/perf/glslstateschange2.vert
593@@ -0,0 +1,14 @@
594+// Multi-texture vertex shader
595+// Brian Paul
596+
597+
598+attribute vec4 TexCoord0, TexCoord1;
599+attribute vec4 VertCoord;
600+
601+void main()
602+{
603+ gl_TexCoord[0] = TexCoord0;
604+ gl_TexCoord[1] = TexCoord1;
605+ // note: may use gl_Vertex or VertCoord here for testing:
606+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
607+}
608diff --git a/src/vpglsl/infinite-loop.glsl b/src/vpglsl/infinite-loop.glsl
609new file mode 100644
610index 0000000..bc7ae4b
611--- /dev/null
612+++ b/src/vpglsl/infinite-loop.glsl
613@@ -0,0 +1,8 @@
614+void main() {
615+ gl_Position = gl_Vertex;
616+ vec4 sum = vec4(0);
617+ for (int i = 1; i != 2; i += 2) {
618+ sum += vec4(0.1, 0.1, 0.1, 0.1);
619+ }
620+ gl_FrontColor = sum;
621+}
622--
6232.0.0
624
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
deleted file mode 100644
index f77b97f3e5..0000000000
--- a/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
+++ /dev/null
@@ -1,234 +0,0 @@
1From 5e10108d76a59abac21c7e540bcfd2ddaccca2cb Mon Sep 17 00:00:00 2001
2From: Drew Moseley <drew_moseley@mentor.com>
3Date: Fri, 9 May 2014 11:50:24 -0400
4Subject: [PATCH 4/9] Use DEMOS_DATA_DIR to locate data files
5
6Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=78496]
7Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
8---
9 src/glsl/bezier.c | 2 +-
10 src/glsl/blinking-teapot.c | 4 ++--
11 src/glsl/brick.c | 4 ++--
12 src/glsl/bump.c | 6 +++---
13 src/glsl/convolutions.c | 2 +-
14 src/glsl/mandelbrot.c | 4 ++--
15 src/glsl/multitex.c | 4 ++--
16 src/glsl/simplex-noise.c | 2 +-
17 src/glsl/skinning.c | 4 ++--
18 src/glsl/texdemo1.c | 8 ++++----
19 src/glsl/toyball.c | 4 ++--
20 src/objviewer/objview.c | 12 ++++++------
21 src/perf/glslstateschange.c | 8 ++++----
22 13 files changed, 32 insertions(+), 32 deletions(-)
23
24diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c
25index 0b56bc1..e01603d 100644
26--- a/src/glsl/bezier.c
27+++ b/src/glsl/bezier.c
28@@ -13,7 +13,7 @@
29 #include "glut_wrap.h"
30 #include "shaderutil.h"
31
32-static const char *filename = "bezier.geom";
33+static const char *filename = DEMOS_DATA_DIR "bezier.geom";
34
35 static GLuint fragShader;
36 static GLuint vertShader;
37diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c
38index e3bf24d..7662b1f 100644
39--- a/src/glsl/blinking-teapot.c
40+++ b/src/glsl/blinking-teapot.c
41@@ -63,8 +63,8 @@ init_opengl (void)
42 exit(1);
43 }
44
45- vshad_id = CompileShaderFile (GL_VERTEX_SHADER, "blinking-teapot.vert");
46- fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, "blinking-teapot.frag");
47+ vshad_id = CompileShaderFile (GL_VERTEX_SHADER, DEMOS_DATA_DIR "blinking-teapot.vert");
48+ fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, DEMOS_DATA_DIR "blinking-teapot.frag");
49 prog_id = LinkShaders (vshad_id, fshad_id);
50
51 UseProgram (prog_id);
52diff --git a/src/glsl/brick.c b/src/glsl/brick.c
53index 3021856..fe5f190 100644
54--- a/src/glsl/brick.c
55+++ b/src/glsl/brick.c
56@@ -14,8 +14,8 @@
57 #include "shaderutil.h"
58
59
60-static char *FragProgFile = "CH06-brick.frag";
61-static char *VertProgFile = "CH06-brick.vert";
62+static char *FragProgFile = DEMOS_DATA_DIR "CH06-brick.frag";
63+static char *VertProgFile = DEMOS_DATA_DIR "CH06-brick.vert";
64
65 /* program/shader objects */
66 static GLuint fragShader;
67diff --git a/src/glsl/bump.c b/src/glsl/bump.c
68index 59f62cd..3a1b20a 100644
69--- a/src/glsl/bump.c
70+++ b/src/glsl/bump.c
71@@ -15,9 +15,9 @@
72 #include "readtex.h"
73
74
75-static char *FragProgFile = "CH11-bumpmap.frag";
76-static char *FragTexProgFile = "CH11-bumpmaptex.frag";
77-static char *VertProgFile = "CH11-bumpmap.vert";
78+static char *FragProgFile = DEMOS_DATA_DIR "CH11-bumpmap.frag";
79+static char *FragTexProgFile = DEMOS_DATA_DIR "CH11-bumpmaptex.frag";
80+static char *VertProgFile = DEMOS_DATA_DIR "CH11-bumpmap.vert";
81 static char *TextureFile = DEMOS_DATA_DIR "tile.rgb";
82
83 /* program/shader objects */
84diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c
85index a120cfe..9312f00 100644
86--- a/src/glsl/convolutions.c
87+++ b/src/glsl/convolutions.c
88@@ -340,7 +340,7 @@ static void init(void)
89
90 menuInit();
91 readTexture(textureLocation);
92- createProgram("convolution.vert", "convolution.frag");
93+ createProgram(DEMOS_DATA_DIR "convolution.vert", DEMOS_DATA_DIR "convolution.frag");
94
95 glEnable(GL_TEXTURE_2D);
96 glClearColor(1.0, 1.0, 1.0, 1.0);
97diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c
98index 31ede1d..ab34a0f 100644
99--- a/src/glsl/mandelbrot.c
100+++ b/src/glsl/mandelbrot.c
101@@ -14,8 +14,8 @@
102 #include "shaderutil.h"
103
104
105-static char *FragProgFile = "CH18-mandel.frag";
106-static char *VertProgFile = "CH18-mandel.vert";
107+static char *FragProgFile = DEMOS_DATA_DIR "CH18-mandel.frag";
108+static char *VertProgFile = DEMOS_DATA_DIR "CH18-mandel.vert";
109
110 /* program/shader objects */
111 static GLuint fragShader;
112diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
113index 262ea50..546bd27 100644
114--- a/src/glsl/multitex.c
115+++ b/src/glsl/multitex.c
116@@ -35,8 +35,8 @@
117
118 static const char *Demo = "multitex";
119
120-static const char *VertFile = "multitex.vert";
121-static const char *FragFile = "multitex.frag";
122+static const char *VertFile = DEMOS_DATA_DIR "multitex.vert";
123+static const char *FragFile = DEMOS_DATA_DIR "multitex.frag";
124
125 static const char *TexFiles[2] =
126 {
127diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c
128index 13fdd5d..885f01e 100644
129--- a/src/glsl/simplex-noise.c
130+++ b/src/glsl/simplex-noise.c
131@@ -169,7 +169,7 @@ SpecialKey(int key, int x, int y)
132 static void
133 Init(void)
134 {
135- const char *filename = "simplex-noise.glsl";
136+ const char *filename = DEMOS_DATA_DIR "simplex-noise.glsl";
137 char noiseText[10000];
138 FILE *f;
139 int len;
140diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c
141index bf38d77..536d475 100644
142--- a/src/glsl/skinning.c
143+++ b/src/glsl/skinning.c
144@@ -20,8 +20,8 @@
145 #define M_PI 3.1415926535
146 #endif
147
148-static char *FragProgFile = "skinning.frag";
149-static char *VertProgFile = "skinning.vert";
150+static char *FragProgFile = DEMOS_DATA_DIR "skinning.frag";
151+static char *VertProgFile = DEMOS_DATA_DIR "skinning.vert";
152
153 /* program/shader objects */
154 static GLuint fragShader;
155diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c
156index 6cde239..a082342 100644
157--- a/src/glsl/texdemo1.c
158+++ b/src/glsl/texdemo1.c
159@@ -35,11 +35,11 @@
160
161 static const char *Demo = "texdemo1";
162
163-static const char *ReflectVertFile = "reflect.vert";
164-static const char *CubeFragFile = "cubemap.frag";
165+static const char *ReflectVertFile = DEMOS_DATA_DIR "reflect.vert";
166+static const char *CubeFragFile = DEMOS_DATA_DIR "cubemap.frag";
167
168-static const char *SimpleVertFile = "simple.vert";
169-static const char *SimpleTexFragFile = "shadowtex.frag";
170+static const char *SimpleVertFile = DEMOS_DATA_DIR "simple.vert";
171+static const char *SimpleTexFragFile = DEMOS_DATA_DIR "shadowtex.frag";
172
173 static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb";
174
175diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c
176index 5f27951..4e7e832 100644
177--- a/src/glsl/toyball.c
178+++ b/src/glsl/toyball.c
179@@ -14,8 +14,8 @@
180 #include "shaderutil.h"
181
182
183-static char *FragProgFile = "CH11-toyball.frag";
184-static char *VertProgFile = "CH11-toyball.vert";
185+static char *FragProgFile = DEMOS_DATA_DIR "CH11-toyball.frag";
186+static char *VertProgFile = DEMOS_DATA_DIR "CH11-toyball.vert";
187
188 /* program/shader objects */
189 static GLuint fragShader;
190diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c
191index 6def726..78a6acf 100644
192--- a/src/objviewer/objview.c
193+++ b/src/objviewer/objview.c
194@@ -162,12 +162,12 @@ init_model(void)
195 static void
196 init_skybox(void)
197 {
198- SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
199- "alpine_west.rgb",
200- "alpine_up.rgb",
201- "alpine_down.rgb",
202- "alpine_south.rgb",
203- "alpine_north.rgb");
204+ SkyboxTex = LoadSkyBoxCubeTexture(DEMOS_DATA_DIR "alpine_east.rgb",
205+ DEMOS_DATA_DIR "alpine_west.rgb",
206+ DEMOS_DATA_DIR "alpine_up.rgb",
207+ DEMOS_DATA_DIR "alpine_down.rgb",
208+ DEMOS_DATA_DIR "alpine_south.rgb",
209+ DEMOS_DATA_DIR "alpine_north.rgb");
210 glmSpecularTexture(Model, SkyboxTex);
211 }
212
213diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
214index 7422b78..dbf8332 100644
215--- a/src/perf/glslstateschange.c
216+++ b/src/perf/glslstateschange.c
217@@ -33,10 +33,10 @@
218 #include "glmain.h"
219 #include "common.h"
220
221-static const char *VertFile1 = "glslstateschange1.vert";
222-static const char *FragFile1 = "glslstateschange1.frag";
223-static const char *VertFile2 = "glslstateschange2.vert";
224-static const char *FragFile2 = "glslstateschange2.frag";
225+static const char *VertFile1 = DEMOS_DATA_DIR "glslstateschange1.vert";
226+static const char *FragFile1 = DEMOS_DATA_DIR "glslstateschange1.frag";
227+static const char *VertFile2 = DEMOS_DATA_DIR "glslstateschange2.vert";
228+static const char *FragFile2 = DEMOS_DATA_DIR "glslstateschange2.frag";
229 static struct uniform_info Uniforms1[] = {
230 { "tex1", 1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
231 { "tex2", 1, GL_SAMPLER_2D, { 1, 0, 0, 0 }, -1 },
232--
2332.0.0
234
diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.5.0.bb b/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb
index 1a64e16a2a..0301b55361 100644
--- a/meta/recipes-graphics/mesa/mesa-demos_8.5.0.bb
+++ b/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb
@@ -9,11 +9,9 @@ LICENSE = "MIT & PD"
9LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \ 9LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \
10 file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06" 10 file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
11 11
12SRC_URI = "https://archive.mesa3d.org/demos/${PV}/${BPN}-${PV}.tar.bz2 \ 12SRC_URI = "https://archive.mesa3d.org/demos/${BPN}-${PV}.tar.xz \
13 file://0001-mesa-demos-Add-missing-data-files.patch \
14 file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
15 " 13 "
16SRC_URI[sha256sum] = "cea2df0a80f09a30f635c4eb1a672bf90c5ddee0b8e77f4d70041668ef71aac1" 14SRC_URI[sha256sum] = "3046a3d26a7b051af7ebdd257a5f23bfeb160cad6ed952329cdff1e9f1ed496b"
17 15
18inherit meson pkgconfig features_check 16inherit meson pkgconfig features_check
19# depends on virtual/egl, virtual/libgl ... 17# depends on virtual/egl, virtual/libgl ...
@@ -21,8 +19,10 @@ REQUIRED_DISTRO_FEATURES = "opengl x11"
21 19
22EXTRA_OEMESON = "-Dwith-system-data-files=true" 20EXTRA_OEMESON = "-Dwith-system-data-files=true"
23 21
22# Note: wayland is not included as the feature requires libdecor recipe,
23# which is not currently in core
24PACKAGECONFIG ?= "drm egl gles1 gles2 \ 24PACKAGECONFIG ?= "drm egl gles1 gles2 \
25 ${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)}" 25 ${@bb.utils.filter('DISTRO_FEATURES', 'vulkan x11', d)}"
26 26
27PACKAGECONFIG[drm] = "-Dlibdrm=enabled,-Dlibdrm=disabled,libdrm" 27PACKAGECONFIG[drm] = "-Dlibdrm=enabled,-Dlibdrm=disabled,libdrm"
28PACKAGECONFIG[egl] = "-Degl=enabled,-Degl=disabled,virtual/egl" 28PACKAGECONFIG[egl] = "-Degl=enabled,-Degl=disabled,virtual/egl"
@@ -30,8 +30,9 @@ PACKAGECONFIG[gles1] = "-Dgles1=enabled,-Dgles1=disabled,virtual/libgles1"
30PACKAGECONFIG[gles2] = "-Dgles2=enabled,-Dgles2=disabled,virtual/libgles2" 30PACKAGECONFIG[gles2] = "-Dgles2=enabled,-Dgles2=disabled,virtual/libgles2"
31PACKAGECONFIG[glut] = "-Dwith-glut=${STAGING_EXECPREFIXDIR},,freeglut" 31PACKAGECONFIG[glut] = "-Dwith-glut=${STAGING_EXECPREFIXDIR},,freeglut"
32PACKAGECONFIG[osmesa] = "-Dosmesa=enabled,-Dosmesa=disabled," 32PACKAGECONFIG[osmesa] = "-Dosmesa=enabled,-Dosmesa=disabled,"
33PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,virtual/libgl wayland wayland-native wayland-protocols" 33PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,vulkan-loader glslang-native"
34PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libglu" 34PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,virtual/libgl wayland wayland-native wayland-protocols libxkbcommon libdecor"
35PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libglu libxkbcommon libxcb"
35 36
36do_install:append() { 37do_install:append() {
37 # it can be completely empty when all PACKAGECONFIG options are disabled 38 # it can be completely empty when all PACKAGECONFIG options are disabled