summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
blob: f77b97f3e5d8729764627320e6a865107de7d512 (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
From 5e10108d76a59abac21c7e540bcfd2ddaccca2cb Mon Sep 17 00:00:00 2001
From: Drew Moseley <drew_moseley@mentor.com>
Date: Fri, 9 May 2014 11:50:24 -0400
Subject: [PATCH 4/9] Use DEMOS_DATA_DIR to locate data files

Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=78496]
Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
---
 src/glsl/bezier.c           |  2 +-
 src/glsl/blinking-teapot.c  |  4 ++--
 src/glsl/brick.c            |  4 ++--
 src/glsl/bump.c             |  6 +++---
 src/glsl/convolutions.c     |  2 +-
 src/glsl/mandelbrot.c       |  4 ++--
 src/glsl/multitex.c         |  4 ++--
 src/glsl/simplex-noise.c    |  2 +-
 src/glsl/skinning.c         |  4 ++--
 src/glsl/texdemo1.c         |  8 ++++----
 src/glsl/toyball.c          |  4 ++--
 src/objviewer/objview.c     | 12 ++++++------
 src/perf/glslstateschange.c |  8 ++++----
 13 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c
index 0b56bc1..e01603d 100644
--- a/src/glsl/bezier.c
+++ b/src/glsl/bezier.c
@@ -13,7 +13,7 @@
 #include "glut_wrap.h"
 #include "shaderutil.h"
 
-static const char *filename = "bezier.geom";
+static const char *filename = DEMOS_DATA_DIR "bezier.geom";
 
 static GLuint fragShader;
 static GLuint vertShader;
diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c
index e3bf24d..7662b1f 100644
--- a/src/glsl/blinking-teapot.c
+++ b/src/glsl/blinking-teapot.c
@@ -63,8 +63,8 @@ init_opengl (void)
      exit(1);
   }     
 
-  vshad_id = CompileShaderFile (GL_VERTEX_SHADER, "blinking-teapot.vert");
-  fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, "blinking-teapot.frag");
+  vshad_id = CompileShaderFile (GL_VERTEX_SHADER, DEMOS_DATA_DIR "blinking-teapot.vert");
+  fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, DEMOS_DATA_DIR "blinking-teapot.frag");
   prog_id = LinkShaders (vshad_id, fshad_id);
 
   UseProgram (prog_id);
diff --git a/src/glsl/brick.c b/src/glsl/brick.c
index 3021856..fe5f190 100644
--- a/src/glsl/brick.c
+++ b/src/glsl/brick.c
@@ -14,8 +14,8 @@
 #include "shaderutil.h"
 
 
-static char *FragProgFile = "CH06-brick.frag";
-static char *VertProgFile = "CH06-brick.vert";
+static char *FragProgFile = DEMOS_DATA_DIR "CH06-brick.frag";
+static char *VertProgFile = DEMOS_DATA_DIR "CH06-brick.vert";
 
 /* program/shader objects */
 static GLuint fragShader;
diff --git a/src/glsl/bump.c b/src/glsl/bump.c
index 59f62cd..3a1b20a 100644
--- a/src/glsl/bump.c
+++ b/src/glsl/bump.c
@@ -15,9 +15,9 @@
 #include "readtex.h"
 
 
-static char *FragProgFile = "CH11-bumpmap.frag";
-static char *FragTexProgFile = "CH11-bumpmaptex.frag";
-static char *VertProgFile = "CH11-bumpmap.vert";
+static char *FragProgFile = DEMOS_DATA_DIR "CH11-bumpmap.frag";
+static char *FragTexProgFile = DEMOS_DATA_DIR "CH11-bumpmaptex.frag";
+static char *VertProgFile = DEMOS_DATA_DIR "CH11-bumpmap.vert";
 static char *TextureFile = DEMOS_DATA_DIR "tile.rgb";
 
 /* program/shader objects */
diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c
index a120cfe..9312f00 100644
--- a/src/glsl/convolutions.c
+++ b/src/glsl/convolutions.c
@@ -340,7 +340,7 @@ static void init(void)
 
    menuInit();
    readTexture(textureLocation);
-   createProgram("convolution.vert", "convolution.frag");
+   createProgram(DEMOS_DATA_DIR "convolution.vert", DEMOS_DATA_DIR "convolution.frag");
 
    glEnable(GL_TEXTURE_2D);
    glClearColor(1.0, 1.0, 1.0, 1.0);
diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c
index 31ede1d..ab34a0f 100644
--- a/src/glsl/mandelbrot.c
+++ b/src/glsl/mandelbrot.c
@@ -14,8 +14,8 @@
 #include "shaderutil.h"
 
 
-static char *FragProgFile = "CH18-mandel.frag";
-static char *VertProgFile = "CH18-mandel.vert";
+static char *FragProgFile = DEMOS_DATA_DIR "CH18-mandel.frag";
+static char *VertProgFile = DEMOS_DATA_DIR "CH18-mandel.vert";
 
 /* program/shader objects */
 static GLuint fragShader;
diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
index 262ea50..546bd27 100644
--- a/src/glsl/multitex.c
+++ b/src/glsl/multitex.c
@@ -35,8 +35,8 @@
 
 static const char *Demo = "multitex";
 
-static const char *VertFile = "multitex.vert";
-static const char *FragFile = "multitex.frag";
+static const char *VertFile = DEMOS_DATA_DIR "multitex.vert";
+static const char *FragFile = DEMOS_DATA_DIR "multitex.frag";
 
 static const char *TexFiles[2] = 
    {
diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c
index 13fdd5d..885f01e 100644
--- a/src/glsl/simplex-noise.c
+++ b/src/glsl/simplex-noise.c
@@ -169,7 +169,7 @@ SpecialKey(int key, int x, int y)
 static void
 Init(void)
 {
-   const char *filename = "simplex-noise.glsl";
+   const char *filename = DEMOS_DATA_DIR "simplex-noise.glsl";
    char noiseText[10000];
    FILE *f;
    int len;
diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c
index bf38d77..536d475 100644
--- a/src/glsl/skinning.c
+++ b/src/glsl/skinning.c
@@ -20,8 +20,8 @@
 #define M_PI 3.1415926535
 #endif
 
-static char *FragProgFile = "skinning.frag";
-static char *VertProgFile = "skinning.vert";
+static char *FragProgFile = DEMOS_DATA_DIR "skinning.frag";
+static char *VertProgFile = DEMOS_DATA_DIR "skinning.vert";
 
 /* program/shader objects */
 static GLuint fragShader;
diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c
index 6cde239..a082342 100644
--- a/src/glsl/texdemo1.c
+++ b/src/glsl/texdemo1.c
@@ -35,11 +35,11 @@
 
 static const char *Demo = "texdemo1";
 
-static const char *ReflectVertFile = "reflect.vert";
-static const char *CubeFragFile = "cubemap.frag";
+static const char *ReflectVertFile = DEMOS_DATA_DIR "reflect.vert";
+static const char *CubeFragFile = DEMOS_DATA_DIR "cubemap.frag";
 
-static const char *SimpleVertFile = "simple.vert";
-static const char *SimpleTexFragFile = "shadowtex.frag";
+static const char *SimpleVertFile = DEMOS_DATA_DIR "simple.vert";
+static const char *SimpleTexFragFile = DEMOS_DATA_DIR "shadowtex.frag";
 
 static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb";
 
diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c
index 5f27951..4e7e832 100644
--- a/src/glsl/toyball.c
+++ b/src/glsl/toyball.c
@@ -14,8 +14,8 @@
 #include "shaderutil.h"
 
 
-static char *FragProgFile = "CH11-toyball.frag";
-static char *VertProgFile = "CH11-toyball.vert";
+static char *FragProgFile = DEMOS_DATA_DIR "CH11-toyball.frag";
+static char *VertProgFile = DEMOS_DATA_DIR "CH11-toyball.vert";
 
 /* program/shader objects */
 static GLuint fragShader;
diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c
index 6def726..78a6acf 100644
--- a/src/objviewer/objview.c
+++ b/src/objviewer/objview.c
@@ -162,12 +162,12 @@ init_model(void)
 static void
 init_skybox(void)
 {
-   SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
-                                     "alpine_west.rgb",
-                                     "alpine_up.rgb",
-                                     "alpine_down.rgb",
-                                     "alpine_south.rgb",
-                                     "alpine_north.rgb");
+   SkyboxTex = LoadSkyBoxCubeTexture(DEMOS_DATA_DIR "alpine_east.rgb",
+                                     DEMOS_DATA_DIR "alpine_west.rgb",
+                                     DEMOS_DATA_DIR "alpine_up.rgb",
+                                     DEMOS_DATA_DIR "alpine_down.rgb",
+                                     DEMOS_DATA_DIR "alpine_south.rgb",
+                                     DEMOS_DATA_DIR "alpine_north.rgb");
    glmSpecularTexture(Model, SkyboxTex);
 }
 
diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
index 7422b78..dbf8332 100644
--- a/src/perf/glslstateschange.c
+++ b/src/perf/glslstateschange.c
@@ -33,10 +33,10 @@
 #include "glmain.h"
 #include "common.h"
 
-static const char *VertFile1 = "glslstateschange1.vert";
-static const char *FragFile1 = "glslstateschange1.frag";
-static const char *VertFile2 = "glslstateschange2.vert";
-static const char *FragFile2 = "glslstateschange2.frag";
+static const char *VertFile1 = DEMOS_DATA_DIR "glslstateschange1.vert";
+static const char *FragFile1 = DEMOS_DATA_DIR "glslstateschange1.frag";
+static const char *VertFile2 = DEMOS_DATA_DIR "glslstateschange2.vert";
+static const char *FragFile2 = DEMOS_DATA_DIR "glslstateschange2.frag";
 static struct uniform_info Uniforms1[] = {
    { "tex1",  1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
    { "tex2",  1, GL_SAMPLER_2D, { 1, 0, 0, 0 }, -1 },
-- 
2.0.0