summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa/mesa-demos
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/mesa/mesa-demos')
-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/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch54
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch424
-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/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch267
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch41
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch74
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch101
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch73
9 files changed, 1892 insertions, 0 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
new file mode 100644
index 0000000000..93ee9c286d
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
@@ -0,0 +1,624 @@
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/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch b/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
new file mode 100644
index 0000000000..c96af12acf
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
@@ -0,0 +1,54 @@
1From 36829a8d7ad2888515fbee95c2a70b3d636d7538 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Wed, 9 Jul 2014 14:30:33 +0200
4Subject: [PATCH 2/9] Correctly implement with AC_WITH(glut) so that
5 --without-glut works.
6
7---
8 configure.ac | 26 +++++++++++++++-----------
9 1 file changed, 15 insertions(+), 11 deletions(-)
10
11diff --git a/configure.ac b/configure.ac
12index c4ee12b..9445424 100644
13--- a/configure.ac
14+++ b/configure.ac
15@@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
16 DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
17
18 dnl Check for GLUT
19-GLUT_CFLAGS=""
20-GLUT_LIBS=-lglut
21-glut_enabled=yes
22+glut_enabled=no
23 AC_ARG_WITH([glut],
24 [AS_HELP_STRING([--with-glut=DIR],
25 [glut install directory])],
26 [GLUT_CFLAGS="-I$withval/include"
27- GLUT_LIBS="-L$withval/lib -lglut"])
28-AC_CHECK_HEADER([GL/glut.h],
29- [],
30- [glut_enabled=no])
31-AC_CHECK_LIB([glut],
32- [glutInit],
33- [],
34- [glut_enabled=no])
35+ GLUT_LIBS="-L$withval/lib -lglut"],
36+ [GLUT_CFLAGS=""
37+ GLUT_LIBS="-lglut"]
38+ )
39+AS_IF([test "x$with_glut" != xno],
40+ [AC_CHECK_HEADER([GL/glut.h],
41+ [],
42+ [glut_enabled=no])
43+ AC_CHECK_LIB([glut],
44+ [glutInit],
45+ [],
46+ [glut_enabled=no])
47+ glut_enabled=yes
48+])
49
50 dnl Check for FreeGLUT 2.6 or later
51 AC_EGREP_HEADER([glutInitContextProfile],
52--
532.0.0
54
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
new file mode 100644
index 0000000000..4b07193a7f
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
@@ -0,0 +1,424 @@
1From b25e9c675cf560b8b037dc855c6b3b1d09957867 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Wed, 9 Jul 2014 14:23:41 +0200
4Subject: [PATCH 3/9] configure: Allow to disable demos which require GLEW or
5 GLU
6
7* in some systems without X11 support we don't have GLEW, but
8 mesa-demos are still useful
9
10Upstream-Status: Pending
11
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13---
14 configure.ac | 49 ++++++++++++++++++++---------
15 src/Makefile.am | 14 ++++++---
16 src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
17 src/egl/Makefile.am | 8 +++--
18 src/egl/opengles1/Makefile.am | 44 +++++++++++++++-----------
19 src/egl/opengles2/Makefile.am | 33 ++++++++++---------
20 6 files changed, 135 insertions(+), 86 deletions(-)
21
22diff --git a/configure.ac b/configure.ac
23index 9445424..bc4c8d1 100644
24--- a/configure.ac
25+++ b/configure.ac
26@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
27 [AC_DEFINE(HAVE_FREEGLUT)],
28 [])
29
30-dnl Check for GLEW
31-PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
32-DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
33-DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
34+AC_ARG_ENABLE([glew],
35+ [AS_HELP_STRING([--enable-glew],
36+ [build demos which require glew @<:@default=yes@:>@])],
37+ [enable_glew="$enableval"],
38+ [enable_glew=yes]
39+)
40+
41+if test "x$enable_glew" = xyes; then
42+ dnl Check for GLEW
43+ PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
44+ DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
45+ DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
46+fi
47
48 # LIBS was set by AC_CHECK_LIB above
49 LIBS=""
50
51-PKG_CHECK_MODULES(GLU, [glu], [],
52- [AC_CHECK_HEADER([GL/glu.h],
53- [],
54- AC_MSG_ERROR([GLU not found]))
55- AC_CHECK_LIB([GLU],
56- [gluBeginCurve],
57- [GLU_LIBS=-lGLU],
58- AC_MSG_ERROR([GLU required])) ])
59+AC_ARG_ENABLE([glu],
60+ [AS_HELP_STRING([--enable-glu],
61+ [build demos which require glu @<:@default=yes@:>@])],
62+ [enable_glu="$enableval"],
63+ [enable_glu=yes]
64+)
65
66-DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
67-DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
68+if test "x$enable_glu" = xyes; then
69+ PKG_CHECK_MODULES(GLU, [glu], [],
70+ [AC_CHECK_HEADER([GL/glu.h],
71+ [],
72+ AC_MSG_ERROR([GLU not found]))
73+ AC_CHECK_LIB([GLU],
74+ [gluBeginCurve],
75+ [GLU_LIBS=-lGLU
76+ glu_enabled=yes],
77+ AC_MSG_ERROR([GLU required])) ])
78+
79+ DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
80+ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
81+fi
82
83 AC_ARG_ENABLE([egl],
84 [AS_HELP_STRING([--enable-egl],
85@@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
86 AC_SUBST([WAYLAND_LIBS])
87
88
89+AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
90+AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
91 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
92 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
93 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
94diff --git a/src/Makefile.am b/src/Makefile.am
95index 1647d64..754c47c 100644
96--- a/src/Makefile.am
97+++ b/src/Makefile.am
98@@ -23,14 +23,18 @@
99 # Eric Anholt <eric@anholt.net>
100
101+if HAVE_GLEW
102+UTIL = util
103+endif
104+
105 SUBDIRS = \
106- util \
107+ $(UTIL) \
108 data \
109 demos \
110 egl \
111 fp \
112 fpglsl \
113 glsl \
114- gs \
115+ gs \
116 objviewer \
117 osdemos \
118 perf \
119@@ -40,8 +39,12 @@ SUBDIRS = \
120 slang \
121 tests \
122 tools \
123- trivial \
124- vp \
125- vpglsl \
126 wgl \
127 xdemos
128+
129+if HAVE_GLEW
130+SUBDIRS += \
131+ vp \
132+ vpglsl \
133+ trivial
134+endif
135diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
136index 41603fa..ab1e3ab 100644
137--- a/src/demos/Makefile.am
138+++ b/src/demos/Makefile.am
139@@ -30,91 +30,100 @@ AM_LDFLAGS = \
140 $(DEMO_LIBS) \
141 $(GLUT_LIBS)
142
143+bin_PROGRAMS =
144+
145 if HAVE_GLUT
146-bin_PROGRAMS = \
147+if HAVE_GLEW
148+bin_PROGRAMS += \
149 arbfplight \
150 arbfslight \
151 arbocclude \
152 arbocclude2 \
153- bounce \
154- clearspd \
155 copypix \
156 cubemap \
157 cuberender \
158 dinoshade \
159- dissolve \
160- drawpix \
161 engine \
162 fbo_firecube \
163 fbotexture \
164- fire \
165 fogcoord \
166 fplight \
167 fslight \
168+ gloss \
169+ isosurf \
170+ multiarb \
171+ paltex \
172+ pointblast \
173+ projtex \
174+ shadowtex \
175+ spriteblast \
176+ stex3d \
177+ textures \
178+ vao_demo \
179+ winpos
180+
181+copypix_LDADD = ../util/libutil.la
182+cubemap_LDADD = ../util/libutil.la
183+cuberender_LDADD = ../util/libutil.la
184+engine_LDADD = ../util/libutil.la
185+fbo_firecube_LDADD = ../util/libutil.la
186+gloss_LDADD = ../util/libutil.la
187+isosurf_LDADD = ../util/libutil.la
188+multiarb_LDADD = ../util/libutil.la
189+projtex_LDADD = ../util/libutil.la
190+textures_LDADD = ../util/libutil.la
191+winpos_LDADD = ../util/libutil.la
192+endif
193+
194+if HAVE_GLU
195+bin_PROGRAMS += \
196+ bounce \
197+ clearspd \
198+ dissolve \
199+ drawpix \
200+ fire \
201 gamma \
202 gearbox \
203 gears \
204 geartrain \
205 glinfo \
206- gloss \
207 gltestperf \
208 ipers \
209- isosurf \
210 lodbias \
211 morph3d \
212- multiarb \
213- paltex \
214 pixeltest \
215- pointblast \
216- projtex \
217 ray \
218 readpix \
219 reflect \
220 renormal \
221- shadowtex \
222 singlebuffer \
223 spectex \
224- spriteblast \
225- stex3d \
226 teapot \
227 terrain \
228 tessdemo \
229 texcyl \
230 texenv \
231- textures \
232 trispd \
233 tunnel2 \
234- tunnel \
235- vao_demo \
236- winpos
237-endif
238+ tunnel
239
240 tunnel_SOURCES = \
241 tunnel.c \
242 tunneldat.h
243
244-copypix_LDADD = ../util/libutil.la
245-cubemap_LDADD = ../util/libutil.la
246-cuberender_LDADD = ../util/libutil.la
247-drawpix_LDADD = ../util/libutil.la
248 dissolve_LDADD = ../util/libutil.la
249-engine_LDADD = ../util/libutil.la
250-fbo_firecube_LDADD = ../util/libutil.la
251+drawpix_LDADD = ../util/libutil.la
252 fire_LDADD = ../util/libutil.la
253-gloss_LDADD = ../util/libutil.la
254 ipers_LDADD = ../util/libutil.la
255-isosurf_LDADD = ../util/libutil.la
256 lodbias_LDADD = ../util/libutil.la
257-multiarb_LDADD = ../util/libutil.la
258-projtex_LDADD = ../util/libutil.la
259 readpix_LDADD = ../util/libutil.la
260 reflect_LDADD = ../util/libutil.la
261 teapot_LDADD = ../util/libutil.la
262 texcyl_LDADD = ../util/libutil.la
263-textures_LDADD = ../util/libutil.la
264 tunnel_LDADD = ../util/libutil.la
265 tunnel2_LDADD = ../util/libutil.la
266-winpos_LDADD = ../util/libutil.la
267+endif
268+endif
269
270 EXTRA_DIST = \
271 README
272diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
273index d64a49e..4fe1ca8 100644
274--- a/src/egl/Makefile.am
275+++ b/src/egl/Makefile.am
276@@ -24,8 +24,12 @@
277
278 SUBDIRS = \
279 eglut \
280- opengl \
281- openvg \
282 opengles1 \
283 opengles2 \
284 oes_vg
285+
286+if HAVE_GLU
287+SUBDIRS += \
288+ opengl \
289+ openvg
290+endif
291diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
292index 7a9828d..3455e75 100644
293--- a/src/egl/opengles1/Makefile.am
294+++ b/src/egl/opengles1/Makefile.am
295@@ -36,28 +36,43 @@ AM_LDFLAGS = \
296 $(EGL_LIBS) \
297 -lm
298
299+noinst_PROGRAMS =
300+
301 if HAVE_EGL
302 if HAVE_GLESV1
303-noinst_PROGRAMS = \
304- bindtex \
305- clear \
306+noinst_PROGRAMS += \
307 drawtex_screen \
308+ gears_screen \
309+ torus_screen \
310+ tri_screen
311+
312+drawtex_screen_SOURCES = drawtex.c
313+gears_screen_SOURCES = gears.c
314+torus_screen_SOURCES = torus.c
315+tri_screen_SOURCES = tri.c
316+
317+drawtex_screen_LDADD = ../eglut/libeglut_screen.la
318+gears_screen_LDADD = ../eglut/libeglut_screen.la
319+torus_screen_LDADD = ../eglut/libeglut_screen.la
320+tri_screen_LDADD = ../eglut/libeglut_screen.la
321+
322+if HAVE_X11
323+noinst_PROGRAMS += \
324+ clear
325+
326+bin_PROGRAMS = \
327+ bindtex \
328 drawtex_x11 \
329 eglfbdev \
330 es1_info \
331- gears_screen \
332 gears_x11 \
333 msaa \
334 pbuffer\
335 render_tex \
336 texture_from_pixmap \
337- torus_screen \
338 torus_x11 \
339- tri_screen \
340 tri_x11 \
341 two_win
342-endif
343-endif
344
345 bindtex_LDADD = $(X11_LIBS)
346 es1_info_LDADD = $(X11_LIBS)
347@@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS)
348 clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS)
349 clear_LDFLAGS =
350
351-drawtex_screen_SOURCES = drawtex.c
352-gears_screen_SOURCES = gears.c
353-torus_screen_SOURCES = torus.c
354-tri_screen_SOURCES = tri.c
355-
356 drawtex_x11_SOURCES = drawtex.c
357 gears_x11_SOURCES = gears.c
358 torus_x11_SOURCES = torus.c
359 tri_x11_SOURCES = tri.c
360
361-drawtex_screen_LDADD = ../eglut/libeglut_screen.la
362-gears_screen_LDADD = ../eglut/libeglut_screen.la
363-torus_screen_LDADD = ../eglut/libeglut_screen.la
364-tri_screen_LDADD = ../eglut/libeglut_screen.la
365-
366 drawtex_x11_LDADD = ../eglut/libeglut_x11.la
367 gears_x11_LDADD = ../eglut/libeglut_x11.la
368 torus_x11_LDADD = ../eglut/libeglut_x11.la
369 tri_x11_LDADD = ../eglut/libeglut_x11.la
370+endif
371+endif
372+endif
373diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
374index 41c1b80..74af460 100644
375--- a/src/egl/opengles2/Makefile.am
376+++ b/src/egl/opengles2/Makefile.am
377@@ -36,26 +36,29 @@ AM_LDFLAGS = \
378 if HAVE_EGL
379 if HAVE_GLESV2
380 bin_PROGRAMS = \
381- es2_info \
382- es2gears_screen \
383- es2gears_x11 \
384- es2tri
385+ es2gears_screen
386+
387+es2gears_screen_SOURCES = es2gears.c
388+es2gears_screen_LDADD = ../eglut/libeglut_screen.la
389+
390 if HAVE_WAYLAND
391 bin_PROGRAMS += es2gears_wayland
392-endif
393-endif
394-endif
395
396-es2_info_LDADD = $(X11_LIBS)
397-es2tri_LDADD = $(X11_LIBS)
398+es2gears_wayland_SOURCES = es2gears.c
399+es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
400+endif
401
402-es2gears_screen_SOURCES = es2gears.c
403+if HAVE_X11
404+bin_PROGRAMS += \
405+ es2tri \
406+ es2_info \
407+ es2gears_x11
408
409+es2_info_LDADD = $(X11_LIBS)
410 es2gears_x11_SOURCES = es2gears.c
411-
412-es2gears_screen_LDADD = ../eglut/libeglut_screen.la
413-
414 es2gears_x11_LDADD = ../eglut/libeglut_x11.la
415+es2tri_LDADD = $(X11_LIBS)
416+endif
417+endif
418+endif
419
420-es2gears_wayland_SOURCES = es2gears.c
421-es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
422--
4232.0.0
424
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
new file mode 100644
index 0000000000..f77b97f3e5
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
@@ -0,0 +1,234 @@
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/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch b/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
new file mode 100644
index 0000000000..aac2a37294
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
@@ -0,0 +1,267 @@
1From 453353a221de9c64479f4372565d2cd8591b36cc Mon Sep 17 00:00:00 2001
2From: Frank Binns <frank.binns@imgtec.com>
3Date: Fri, 29 Jun 2012 11:26:04 +0100
4Subject: [PATCH 5/9] Fix build when EGL_MESA_screen_surface extension isn't
5 present
6
7The EGL demos won't build against EGL implementations that don't support
8the EGL_MESA_screen_surface extension. Fix this, in most cases, by
9wrapping relevant bits of code in #ifdef EGL_MESA_screen_surface.
10
11Signed-off-by: Frank Binns <frank.binns@imgtec.com>
12
13Applied and fixed up in Yocto by...
14
15Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
16
17Upstream-Status: Pending
18---
19 src/egl/eglut/eglut.c | 9 +++++++--
20 src/egl/eglut/eglut_screen.c | 14 ++++++++++++++
21 src/egl/opengl/demo1.c | 2 ++
22 src/egl/opengl/demo2.c | 7 ++++++-
23 src/egl/opengl/demo3.c | 7 ++++++-
24 5 files changed, 35 insertions(+), 4 deletions(-)
25
26diff --git a/src/egl/eglut/eglut.c b/src/egl/eglut/eglut.c
27index 2ee6f15..f6a2ad4 100644
28--- a/src/egl/eglut/eglut.c
29+++ b/src/egl/eglut/eglut.c
30@@ -76,8 +76,9 @@ _eglutNow(void)
31 static void
32 _eglutDestroyWindow(struct eglut_window *win)
33 {
34- if (_eglut->surface_type != EGL_PBUFFER_BIT &&
35- _eglut->surface_type != EGL_SCREEN_BIT_MESA)
36+
37+ if (_eglut->surface_type == EGL_WINDOW_BIT ||
38+ _eglut->surface_type == EGL_PIXMAP_BIT)
39 eglDestroySurface(_eglut->dpy, win->surface);
40
41 _eglutNativeFiniWindow(win);
42@@ -175,7 +176,9 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h)
43 win->config, win->native.u.pixmap, NULL);
44 break;
45 case EGL_PBUFFER_BIT:
46+#ifdef EGL_MESA_screen_surface
47 case EGL_SCREEN_BIT_MESA:
48+#endif
49 win->surface = win->native.u.surface;
50 break;
51 default:
52@@ -289,8 +292,10 @@ eglutDestroyWindow(int win)
53 if (window->index != win)
54 return;
55
56+#ifdef EGL_MESA_screen_surface
57 /* XXX it causes some bug in st/egl KMS backend */
58 if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA)
59+#endif
60 eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
61
62 _eglutDestroyWindow(_eglut->current);
63diff --git a/src/egl/eglut/eglut_screen.c b/src/egl/eglut/eglut_screen.c
64index 021a8f1..094a4e2 100644
65--- a/src/egl/eglut/eglut_screen.c
66+++ b/src/egl/eglut/eglut_screen.c
67@@ -35,26 +35,33 @@
68
69 #define MAX_MODES 100
70
71+#ifdef EGL_MESA_screen_surface
72 static EGLScreenMESA kms_screen;
73 static EGLModeMESA kms_mode;
74 static EGLint kms_width, kms_height;
75+#endif
76
77 void
78 _eglutNativeInitDisplay(void)
79 {
80+#ifdef EGL_MESA_screen_surface
81 _eglut->native_dpy = EGL_DEFAULT_DISPLAY;
82 _eglut->surface_type = EGL_SCREEN_BIT_MESA;
83+#endif
84 }
85
86 void
87 _eglutNativeFiniDisplay(void)
88 {
89+#ifdef EGL_MESA_screen_surface
90 kms_screen = 0;
91 kms_mode = 0;
92 kms_width = 0;
93 kms_height = 0;
94+#endif
95 }
96
97+#ifdef EGL_MESA_screen_surface
98 static void
99 init_kms(void)
100 {
101@@ -94,19 +101,23 @@ init_kms(void)
102 kms_width = width;
103 kms_height = height;
104 }
105+#endif
106
107 void
108 _eglutNativeInitWindow(struct eglut_window *win, const char *title,
109 int x, int y, int w, int h)
110 {
111+#ifdef EGL_MESA_screen_surface
112 EGLint surf_attribs[16];
113 EGLint i;
114+#endif
115 const char *exts;
116
117 exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS);
118 if (!exts || !strstr(exts, "EGL_MESA_screen_surface"))
119 _eglutFatal("EGL_MESA_screen_surface is not supported\n");
120
121+#ifdef EGL_MESA_screen_surface
122 init_kms();
123
124 i = 0;
125@@ -128,14 +139,17 @@ _eglutNativeInitWindow(struct eglut_window *win, const char *title,
126
127 win->native.width = kms_width;
128 win->native.height = kms_height;
129+#endif
130 }
131
132 void
133 _eglutNativeFiniWindow(struct eglut_window *win)
134 {
135+#ifdef EGL_MESA_screen_surface
136 eglShowScreenSurfaceMESA(_eglut->dpy,
137 kms_screen, EGL_NO_SURFACE, 0);
138 eglDestroySurface(_eglut->dpy, win->native.u.surface);
139+#endif
140 }
141
142 void
143diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
144index d892734..3a3564c 100644
145--- a/src/egl/opengl/demo1.c
146+++ b/src/egl/opengl/demo1.c
147@@ -18,6 +18,7 @@
148 static void
149 TestScreens(EGLDisplay dpy)
150 {
151+#ifdef EGL_MESA_screen_surface
152 #define MAX 8
153 EGLScreenMESA screens[MAX];
154 EGLint numScreens;
155@@ -28,6 +29,7 @@ TestScreens(EGLDisplay dpy)
156 for (i = 0; i < numScreens; i++) {
157 printf(" Screen %d handle: %d\n", i, (int) screens[i]);
158 }
159+#endif
160 }
161
162 /**
163diff --git a/src/egl/opengl/demo2.c b/src/egl/opengl/demo2.c
164index 505b474..bfef59e 100644
165--- a/src/egl/opengl/demo2.c
166+++ b/src/egl/opengl/demo2.c
167@@ -16,6 +16,7 @@
168
169 /*#define FRONTBUFFER*/
170
171+#ifdef EGL_MESA_screen_surface
172 static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
173 GLfloat r, GLfloat g, GLfloat b)
174 {
175@@ -95,12 +96,13 @@ TestScreens(EGLDisplay dpy)
176 printf(" Screen %d handle: %d\n", i, (int) screens[i]);
177 }
178 }
179-
180+#endif
181
182 int
183 main(int argc, char *argv[])
184 {
185 int maj, min;
186+#ifdef EGL_MESA_screen_surface
187 EGLContext ctx;
188 EGLSurface pbuffer, screen_surf;
189 EGLConfig configs[10];
190@@ -115,6 +117,7 @@ main(int argc, char *argv[])
191 EGLModeMESA mode;
192 EGLScreenMESA screen;
193 EGLint count;
194+#endif
195
196 EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
197 assert(d);
198@@ -132,6 +135,7 @@ main(int argc, char *argv[])
199 exit(1);
200 }
201
202+#ifdef EGL_MESA_screen_surface
203 eglGetConfigs(d, configs, 10, &numConfigs);
204 printf("Got %d EGL configs:\n", numConfigs);
205 for (i = 0; i < numConfigs; i++) {
206@@ -211,6 +215,7 @@ main(int argc, char *argv[])
207 eglDestroySurface(d, pbuffer);
208 eglDestroyContext(d, ctx);
209 eglTerminate(d);
210+#endif
211
212 return 0;
213 }
214diff --git a/src/egl/opengl/demo3.c b/src/egl/opengl/demo3.c
215index f84ca23..31b5d8b 100644
216--- a/src/egl/opengl/demo3.c
217+++ b/src/egl/opengl/demo3.c
218@@ -46,7 +46,7 @@ GLubyte OpenGL_bits[] = {
219 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
220 };
221
222-
223+#ifdef EGL_MESA_screen_surface
224 static void Init(void)
225 {
226
227@@ -551,11 +551,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
228 fclose(f);
229 }
230 }
231+#endif
232
233 int
234 main(int argc, char *argv[])
235 {
236 int maj, min;
237+#ifdef EGL_MESA_screen_surface
238 EGLContext ctx;
239 EGLSurface screen_surf;
240 EGLConfig configs[10];
241@@ -566,6 +568,7 @@ main(int argc, char *argv[])
242 const GLubyte *bitmap;
243 EGLint screenAttribs[32];
244 EGLint i;
245+#endif
246
247 EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
248 assert(d);
249@@ -583,6 +586,7 @@ main(int argc, char *argv[])
250 exit(1);
251 }
252
253+#ifdef EGL_MESA_screen_surface
254 eglGetConfigs(d, configs, 10, &numConfigs);
255 eglGetScreensMESA(d, &screen, 1, &count);
256 eglGetModesMESA(d, screen, &mode, 1, &count);
257@@ -642,6 +646,7 @@ main(int argc, char *argv[])
258 eglDestroySurface(d, screen_surf);
259 eglDestroyContext(d, ctx);
260 eglTerminate(d);
261+#endif
262
263 return 0;
264 }
265--
2662.0.0
267
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch b/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
new file mode 100644
index 0000000000..12e0805f15
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
@@ -0,0 +1,41 @@
1From 6a19dba1d275579c73e7763b0554410ff4e1e650 Mon Sep 17 00:00:00 2001
2From: Frank Binns <frank.binns@imgtec.com>
3Date: Fri, 29 Jun 2012 12:00:26 +0100
4Subject: [PATCH 6/9] Query display for EGL_MESA_screen_surface extension
5 before using it
6
7This code makes heavy use of the EGL_MESA_screen_surface extension so
8check the display to determine if it's supported by the underlying EGL
9implementation. If it doesn't then bail.
10
11Signed-off-by: Frank Binns <frank.binns@imgtec.com>
12
13Applied and fixed up in Yocto by...
14
15Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
16
17Upstream-Status: Pending
18---
19 src/egl/opengl/demo1.c | 6 ++++++
20 1 file changed, 6 insertions(+)
21
22diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
23index 3a3564c..06e2138 100644
24--- a/src/egl/opengl/demo1.c
25+++ b/src/egl/opengl/demo1.c
26@@ -110,6 +110,12 @@ main(int argc, char *argv[])
27 printf("EGL version = %d.%d\n", maj, min);
28 printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
29
30+ if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
31+ "EGL_MESA_screen_surface")) {
32+ printf("EGL_MESA_screen_surface is not supported\n");
33+ exit(1);
34+ }
35+
36 eglGetConfigs(d, NULL, 0, &numConfigs);
37 configs = malloc(sizeof(*configs) *numConfigs);
38 eglGetConfigs(d, configs, numConfigs, &numConfigs);
39--
402.0.0
41
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch b/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
new file mode 100644
index 0000000000..89d2fac4fd
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
@@ -0,0 +1,74 @@
1From d930b2da57f7c9efb80c8cef8f8adad15bbbc0d3 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 10 Jul 2014 14:30:52 +0200
4Subject: [PATCH 7/9] Install few more test programs
5
6Upstream-Status: Pending
7
8Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
9---
10 src/egl/opengl/Makefile.am | 2 +-
11 src/egl/opengles1/Makefile.am | 10 ++++------
12 src/egl/openvg/Makefile.am | 2 +-
13 3 files changed, 6 insertions(+), 8 deletions(-)
14
15diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
16index 0c7228f..87b2f1a 100644
17--- a/src/egl/opengl/Makefile.am
18+++ b/src/egl/opengl/Makefile.am
19@@ -50,7 +50,7 @@ endif
20 endif
21
22 if HAVE_EGL
23-noinst_PROGRAMS = \
24+bin_PROGRAMS = \
25 demo1 \
26 demo2 \
27 demo3 \
28diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
29index 3455e75..516e516 100644
30--- a/src/egl/opengles1/Makefile.am
31+++ b/src/egl/opengles1/Makefile.am
32@@ -36,11 +36,11 @@ AM_LDFLAGS = \
33 $(EGL_LIBS) \
34 -lm
35
36-noinst_PROGRAMS =
37+bin_PROGRAMS =
38
39 if HAVE_EGL
40 if HAVE_GLESV1
41-noinst_PROGRAMS += \
42+bin_PROGRAMS += \
43 drawtex_screen \
44 gears_screen \
45 torus_screen \
46@@ -57,10 +57,8 @@ torus_screen_LDADD = ../eglut/libeglut_screen.la
47 tri_screen_LDADD = ../eglut/libeglut_screen.la
48
49 if HAVE_X11
50-noinst_PROGRAMS += \
51- clear
52-
53-bin_PROGRAMS = \
54+bin_PROGRAMS += \
55+ clear \
56 bindtex \
57 drawtex_x11 \
58 eglfbdev \
59diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am
60index 7318a43..b545225 100644
61--- a/src/egl/openvg/Makefile.am
62+++ b/src/egl/openvg/Makefile.am
63@@ -49,7 +49,7 @@ endif
64
65 if HAVE_EGL
66 if HAVE_VG
67-noinst_PROGRAMS = \
68+bin_PROGRAMS = \
69 lion_screen \
70 sp_screen \
71 $(EGL_X11_DEMOS)
72--
732.0.0
74
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch b/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
new file mode 100644
index 0000000000..a6085754d2
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
@@ -0,0 +1,101 @@
1From 0b6f95f9b8ece22e9856c150e4be29fd86eaf546 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 10 Jul 2014 14:29:27 +0200
4Subject: [PATCH 8/9] glsl, perf: Add few missing .glsl, .vert, .frag files to
5 EXTRA_DATA
6
7Upstream-Status: Pending
8
9Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
10---
11 src/fpglsl/Makefile.am | 2 ++
12 src/glsl/Makefile.am | 10 ++++++++--
13 src/perf/Makefile.am | 6 ++++++
14 src/vpglsl/Makefile.am | 1 +
15 4 files changed, 17 insertions(+), 2 deletions(-)
16
17diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
18index 47c1039..fd43c91 100644
19--- a/src/fpglsl/Makefile.am
20+++ b/src/fpglsl/Makefile.am
21@@ -39,10 +39,12 @@ noinst_PROGRAMS = \
22 endif
23
24 EXTRA_DIST = \
25+ depth-read.glsl \
26 dowhile2.glsl \
27 dowhile.glsl \
28 forbreak.glsl \
29 for.glsl \
30+ infinite-loop.glsl \
31 mov.glsl \
32 mov-imm.glsl \
33 simpleif.glsl \
34diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
35index 4faa8db..079a29d 100644
36--- a/src/glsl/Makefile.am
37+++ b/src/glsl/Makefile.am
38@@ -37,7 +37,7 @@ AM_LDFLAGS = \
39 if HAVE_GLUT
40 bin_PROGRAMS = \
41 array \
42- bezier \
43+ bezier \
44 bitmap \
45 brick \
46 bump \
47@@ -123,12 +123,16 @@ EXTRA_DIST = \
48 CH06-brick.vert \
49 CH11-bumpmap.frag \
50 CH11-bumpmap.vert \
51+ CH11-bumpmaptex.frag \
52 CH11-toyball.frag \
53 CH11-toyball.vert \
54 CH18-mandel.frag \
55 CH18-mandel.vert \
56- bezier.geom \
57+ bezier.geom \
58 brick.shtest \
59+ blinking-teapot.frag \
60+ blinking-teapot.vert \
61+ convolution.frag \
62 convolution.vert \
63 cubemap.frag \
64 mandelbrot.shtest \
65@@ -138,5 +142,7 @@ EXTRA_DIST = \
66 reflect.vert \
67 shadowtex.frag \
68 simple.vert \
69+ simplex-noise.glsl \
70 skinning.frag \
71+ skinning.vert \
72 toyball.shtest
73diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
74index 5363c58..c5cca8d 100644
75--- a/src/perf/Makefile.am
76+++ b/src/perf/Makefile.am
77@@ -57,3 +57,9 @@ bin_PROGRAMS = \
78 endif
79
80 glslstateschange_LDADD = libperf.la ../util/libutil.la
81+
82+EXTRA_DIST = \
83+ glslstateschange1.frag \
84+ glslstateschange1.vert \
85+ glslstateschange2.frag \
86+ glslstateschange2.vert
87diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
88index 4a85ed4..48b08f4 100644
89--- a/src/vpglsl/Makefile.am
90+++ b/src/vpglsl/Makefile.am
91@@ -44,6 +44,7 @@ EXTRA_DIST = \
92 func2.glsl \
93 ifelse.glsl \
94 if.glsl \
95+ infinite-loop.glsl \
96 mov.glsl \
97 nestedifs.glsl \
98 nestedswizzle.glsl \
99--
1002.0.0
101
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
new file mode 100644
index 0000000000..1262dee237
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
@@ -0,0 +1,73 @@
1From c8c3de5417d6b6c7d7579c528c0cab718f4bfdb6 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 10 Jul 2014 14:48:12 +0200
4Subject: [PATCH 9/9] glsl, perf: Install .glsl, .vert, .frag files
5
6Upstream-Status: Pending
7Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
8---
9 src/fpglsl/Makefile.am | 3 ++-
10 src/glsl/Makefile.am | 3 ++-
11 src/perf/Makefile.am | 3 ++-
12 src/vpglsl/Makefile.am | 3 ++-
13 4 files changed, 8 insertions(+), 4 deletions(-)
14
15diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
16index fd43c91..2bf51de 100644
17--- a/src/fpglsl/Makefile.am
18+++ b/src/fpglsl/Makefile.am
19@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
20 fp-tri
21 endif
22
23-EXTRA_DIST = \
24+demosdatadir=$(datadir)/$(PACKAGE)/
25+dist_demosdata_DATA= \
26 depth-read.glsl \
27 dowhile2.glsl \
28 dowhile.glsl \
29diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
30index 079a29d..f66ec29 100644
31--- a/src/glsl/Makefile.am
32+++ b/src/glsl/Makefile.am
33@@ -118,7 +118,8 @@ vert_or_frag_only_LDADD = ../util/libutil.la
34 vert_tex_LDADD = ../util/libutil.la
35 vsraytrace_LDADD = ../util/libutil.la
36
37-EXTRA_DIST = \
38+demosdatadir=$(datadir)/$(PACKAGE)/
39+dist_demosdata_DATA= \
40 CH06-brick.frag \
41 CH06-brick.vert \
42 CH11-bumpmap.frag \
43diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
44index c5cca8d..140256d 100644
45--- a/src/perf/Makefile.am
46+++ b/src/perf/Makefile.am
47@@ -58,7 +58,8 @@ endif
48
49 glslstateschange_LDADD = libperf.la ../util/libutil.la
50
51-EXTRA_DIST = \
52+demosdatadir=$(datadir)/$(PACKAGE)/
53+dist_demosdata_DATA= \
54 glslstateschange1.frag \
55 glslstateschange1.vert \
56 glslstateschange2.frag \
57diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
58index 48b08f4..5526867 100644
59--- a/src/vpglsl/Makefile.am
60+++ b/src/vpglsl/Makefile.am
61@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
62 vp-tris
63 endif
64
65-EXTRA_DIST = \
66+demosdatadir=$(datadir)/$(PACKAGE)/
67+dist_demosdata_DATA= \
68 for.glsl \
69 func.glsl \
70 func2.glsl \
71--
722.0.0
73