Merge lp:~glmark2-dev/glmark2/config-update into lp:glmark2/2011.11

Proposed by Jesse Barker
Status: Merged
Merged at revision: 253
Proposed branch: lp:~glmark2-dev/glmark2/config-update
Merge into: lp:glmark2/2011.11
Diff against target: 331 lines (+100/-13)
7 files modified
android/src/org/linaro/glmark2/GLVisualConfig.java (+3/-1)
android/src/org/linaro/glmark2/Glmark2SurfaceView.java (+6/-1)
src/canvas-x11-glx.cpp (+7/-3)
src/egl-state.cpp (+55/-4)
src/egl-state.h (+21/-0)
src/gl-visual-config.cpp (+4/-1)
src/gl-visual-config.h (+4/-3)
To merge this branch: bzr merge lp:~glmark2-dev/glmark2/config-update
Reviewer Review Type Date Requested Status
Alexandros Frantzis Approve
Review via email: mp+138342@code.launchpad.net

Description of the change

A couple of small changes to config support.

EGLState: Adds queries for remaining attributes from table 3.1 of the EGL spec (they are unused by any normal runtime logic in glmark2, but could be useful for debugging purposes).

GLVisualConfig: Adds a stencil attribute, and updates the scoring logic to explicitly favor no stencil unless asked for by command line option.

To post a comment you must log in.
255. By Alexandros Frantzis

CanvasX11GLX: Print out the stencil size of the selected config in debug mode

Revision history for this message
Alexandros Frantzis (afrantzis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'android/src/org/linaro/glmark2/GLVisualConfig.java'
2--- android/src/org/linaro/glmark2/GLVisualConfig.java 2012-07-04 14:27:42 +0000
3+++ android/src/org/linaro/glmark2/GLVisualConfig.java 2012-12-06 18:00:32 +0000
4@@ -26,12 +26,13 @@
5 */
6 class GLVisualConfig {
7 public GLVisualConfig() {}
8- public GLVisualConfig(int r, int g, int b, int a, int d, int buf) {
9+ public GLVisualConfig(int r, int g, int b, int a, int d, int s, int buf) {
10 red = r;
11 green = g;
12 blue = b;
13 alpha = a;
14 depth = d;
15+ stencil = s;
16 buffer = buf;
17 }
18
19@@ -40,5 +41,6 @@
20 public int blue;
21 public int alpha;
22 public int depth;
23+ public int stencil;
24 public int buffer;
25 }
26
27=== modified file 'android/src/org/linaro/glmark2/Glmark2SurfaceView.java'
28--- android/src/org/linaro/glmark2/Glmark2SurfaceView.java 2012-07-30 12:28:16 +0000
29+++ android/src/org/linaro/glmark2/Glmark2SurfaceView.java 2012-12-06 18:00:32 +0000
30@@ -50,7 +50,7 @@
31
32 /* Parse the config string parameters */
33 String[] configParams = configString.split(":");
34- GLVisualConfig targetConfig = new GLVisualConfig(5, 6, 5, 0, 16, 1);
35+ GLVisualConfig targetConfig = new GLVisualConfig(5, 6, 5, 0, 16, 0, 1);
36
37 for (String param : configParams) {
38 String[] paramKeyValue = param.split("=");
39@@ -67,6 +67,8 @@
40 targetConfig.alpha = Integer.parseInt(paramKeyValue[1]);
41 else if (paramKeyValue[0].equals("depth") || paramKeyValue[0].equals("d"))
42 targetConfig.depth = Integer.parseInt(paramKeyValue[1]);
43+ else if (paramKeyValue[0].equals("stencil") || paramKeyValue[0].equals("s"))
44+ targetConfig.stencil = Integer.parseInt(paramKeyValue[1]);
45 else if (paramKeyValue[0].equals("buffer") || paramKeyValue[0].equals("buf"))
46 targetConfig.buffer = Integer.parseInt(paramKeyValue[1]);
47 }
48@@ -89,6 +91,7 @@
49 EGL10.EGL_BLUE_SIZE, targetConfig.blue,
50 EGL10.EGL_ALPHA_SIZE, targetConfig.alpha,
51 EGL10.EGL_DEPTH_SIZE, targetConfig.depth,
52+ EGL10.EGL_STENCIL_SIZE, targetConfig.stencil,
53 EGL10.EGL_BUFFER_SIZE, targetConfig.buffer,
54 EGL10.EGL_RENDERABLE_TYPE, 4, /* 4 = EGL_OPENGL_ES2_BIT */
55 EGL10.EGL_NONE };
56@@ -156,6 +159,8 @@
57 EGL10.EGL_ALPHA_SIZE, 0);
58 vc.depth = findConfigAttrib(egl, display, config,
59 EGL10.EGL_DEPTH_SIZE, 0);
60+ vc.stencil = findConfigAttrib(egl, display, config,
61+ EGL10.EGL_STENCIL_SIZE, 0);
62 vc.buffer = findConfigAttrib(egl, display, config,
63 EGL10.EGL_BUFFER_SIZE, 0);
64
65
66=== modified file 'src/canvas-x11-glx.cpp'
67--- src/canvas-x11-glx.cpp 2012-08-23 22:47:12 +0000
68+++ src/canvas-x11-glx.cpp 2012-12-06 18:00:32 +0000
69@@ -171,6 +171,7 @@
70 GLX_BLUE_SIZE, visual_config_.blue,
71 GLX_ALPHA_SIZE, visual_config_.alpha,
72 GLX_DEPTH_SIZE, visual_config_.depth,
73+ GLX_STENCIL_SIZE, visual_config_.stencil,
74 GLX_BUFFER_SIZE, visual_config_.buffer,
75 GLX_DOUBLEBUFFER, True,
76 None
77@@ -200,7 +201,7 @@
78 XFree(fbc);
79
80 if (Options::show_debug) {
81- int buf, red, green, blue, alpha, depth, id, native_id;
82+ int buf, red, green, blue, alpha, depth, stencil, id, native_id;
83 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_FBCONFIG_ID, &id);
84 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_VISUAL_ID, &native_id);
85 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BUFFER_SIZE, &buf);
86@@ -209,15 +210,17 @@
87 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BLUE_SIZE, &blue);
88 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_ALPHA_SIZE, &alpha);
89 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_DEPTH_SIZE, &depth);
90+ glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_STENCIL_SIZE, &stencil);
91 Log::debug("GLX chosen config ID: 0x%x Native Visual ID: 0x%x\n"
92 " Buffer: %d bits\n"
93 " Red: %d bits\n"
94 " Green: %d bits\n"
95 " Blue: %d bits\n"
96 " Alpha: %d bits\n"
97- " Depth: %d bits\n",
98+ " Depth: %d bits\n"
99+ " Stencil: %d bits\n",
100 id, native_id,
101- buf, red, green, blue, alpha, depth);
102+ buf, red, green, blue, alpha, depth, stencil);
103 }
104
105
106@@ -270,6 +273,7 @@
107 glXGetFBConfigAttrib(xdpy_, config, GLX_BLUE_SIZE, &visual_config.blue);
108 glXGetFBConfigAttrib(xdpy_, config, GLX_ALPHA_SIZE, &visual_config.alpha);
109 glXGetFBConfigAttrib(xdpy_, config, GLX_DEPTH_SIZE, &visual_config.depth);
110+ glXGetFBConfigAttrib(xdpy_, config, GLX_STENCIL_SIZE, &visual_config.stencil);
111 }
112
113 GLXFBConfig
114
115=== modified file 'src/egl-state.cpp'
116--- src/egl-state.cpp 2012-11-15 23:06:53 +0000
117+++ src/egl-state.cpp 2012-12-06 18:00:32 +0000
118@@ -38,10 +38,19 @@
119 luminanceSize_(0),
120 alphaSize_(0),
121 alphaMaskSize_(0),
122+ bindTexRGB_(false),
123+ bindTexRGBA_(false),
124 bufferType_(EGL_RGB_BUFFER),
125 caveat_(0),
126 configID_(0),
127+ conformant_(0),
128 depthSize_(0),
129+ level_(0),
130+ pbufferWidth_(0),
131+ pbufferHeight_(0),
132+ pbufferPixels_(0),
133+ minSwapInterval_(0),
134+ maxSwapInterval_(0),
135 nativeID_(0),
136 nativeType_(0),
137 nativeRenderable_(false),
138@@ -63,6 +72,10 @@
139 {
140 badAttribVec.push_back("EGL_CONFIG_CAVEAT");
141 }
142+ if (!eglGetConfigAttrib(dpy, handle_, EGL_CONFORMANT, &conformant_))
143+ {
144+ badAttribVec.push_back("EGL_CONFORMANT");
145+ }
146 if (!eglGetConfigAttrib(dpy, handle_, EGL_COLOR_BUFFER_TYPE, &bufferType_))
147 {
148 badAttribVec.push_back("EGL_COLOR_BUFFER_TYPE");
149@@ -98,6 +111,10 @@
150 {
151 badAttribVec.push_back("EGL_ALPHA_SIZE");
152 }
153+ if (!eglGetConfigAttrib(dpy, handle_, EGL_ALPHA_MASK_SIZE, &alphaMaskSize_))
154+ {
155+ badAttribVec.push_back("EGL_ALPHA_MASK_SIZE");
156+ }
157 if (!eglGetConfigAttrib(dpy, handle_, EGL_DEPTH_SIZE, &depthSize_))
158 {
159 badAttribVec.push_back("EGL_DEPTH_SIZE");
160@@ -106,15 +123,47 @@
161 {
162 badAttribVec.push_back("EGL_STENCIL_SIZE");
163 }
164+ EGLint doBind(EGL_FALSE);
165+ if (!eglGetConfigAttrib(dpy, handle_, EGL_BIND_TO_TEXTURE_RGB, &doBind))
166+ {
167+ badAttribVec.push_back("EGL_BIND_TO_TEXTURE_RGB");
168+ }
169+ bindTexRGB_ = (doBind == EGL_TRUE);
170+ if (!eglGetConfigAttrib(dpy, handle_, EGL_BIND_TO_TEXTURE_RGBA, &doBind))
171+ {
172+ badAttribVec.push_back("EGL_BIND_TO_TEXTURE_RGBA");
173+ }
174+ bindTexRGBA_ = (doBind == EGL_TRUE);
175+ if (!eglGetConfigAttrib(dpy, handle_, EGL_LEVEL, &level_))
176+ {
177+ badAttribVec.push_back("EGL_LEVEL");
178+ }
179+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_WIDTH, &pbufferWidth_))
180+ {
181+ badAttribVec.push_back("EGL_MAX_PBUFFER_WIDTH");
182+ }
183+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_HEIGHT, &pbufferHeight_))
184+ {
185+ badAttribVec.push_back("EGL_MAX_PBUFFER_HEIGHT");
186+ }
187+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_PIXELS, &pbufferPixels_))
188+ {
189+ badAttribVec.push_back("EGL_MAX_PBUFFER_PIXELS");
190+ }
191+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MIN_SWAP_INTERVAL, &minSwapInterval_))
192+ {
193+ badAttribVec.push_back("EGL_MIN_SWAP_INTERVAL");
194+ }
195+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_SWAP_INTERVAL, &maxSwapInterval_))
196+ {
197+ badAttribVec.push_back("EGL_MAX_SWAP_INTERVAL");
198+ }
199 EGLint doNative(EGL_FALSE);
200 if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_RENDERABLE, &doNative))
201 {
202 badAttribVec.push_back("EGL_NATIVE_RENDERABLE");
203 }
204- if (doNative == EGL_TRUE)
205- {
206- nativeRenderable_ = true;
207- }
208+ nativeRenderable_ = (doNative == EGL_TRUE);
209 if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_VISUAL_TYPE, &nativeType_))
210 {
211 badAttribVec.push_back("EGL_NATIVE_VISUAL_TYPE");
212@@ -293,6 +342,7 @@
213 eglGetConfigAttrib(egl_display_, config, EGL_BLUE_SIZE, &visual_config.blue);
214 eglGetConfigAttrib(egl_display_, config, EGL_ALPHA_SIZE, &visual_config.alpha);
215 eglGetConfigAttrib(egl_display_, config, EGL_DEPTH_SIZE, &visual_config.depth);
216+ eglGetConfigAttrib(egl_display_, config, EGL_STENCIL_SIZE, &visual_config.stencil);
217 }
218
219 EGLConfig
220@@ -341,6 +391,7 @@
221 EGL_BLUE_SIZE, visual_config_.blue,
222 EGL_ALPHA_SIZE, visual_config_.alpha,
223 EGL_DEPTH_SIZE, visual_config_.depth,
224+ EGL_STENCIL_SIZE, visual_config_.stencil,
225 #if USE_GLESv2
226 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
227 #elif USE_GL
228
229=== modified file 'src/egl-state.h'
230--- src/egl-state.h 2012-11-13 16:53:41 +0000
231+++ src/egl-state.h 2012-12-06 18:00:32 +0000
232@@ -37,12 +37,24 @@
233 EGLint luminanceSize_;
234 EGLint alphaSize_;
235 EGLint alphaMaskSize_;
236+ bool bindTexRGB_;
237+ bool bindTexRGBA_;
238 EGLint bufferType_;
239 // Base config attributes
240 EGLint caveat_;
241 EGLint configID_;
242+ EGLint conformant_;
243 // Depth buffer
244 EGLint depthSize_;
245+ // Framebuffer level
246+ EGLint level_;
247+ // Pbuffers
248+ EGLint pbufferWidth_;
249+ EGLint pbufferHeight_;
250+ EGLint pbufferPixels_;
251+ // Swap interval
252+ EGLint minSwapInterval_;
253+ EGLint maxSwapInterval_;
254 // Native window system attributes.
255 EGLint nativeID_;
256 EGLint nativeType_;
257@@ -69,10 +81,19 @@
258 luminanceSize_(0),
259 alphaSize_(0),
260 alphaMaskSize_(0),
261+ bindTexRGB_(false),
262+ bindTexRGBA_(false),
263 bufferType_(EGL_RGB_BUFFER),
264 caveat_(0),
265 configID_(0),
266+ conformant_(0),
267 depthSize_(0),
268+ level_(0),
269+ pbufferWidth_(0),
270+ pbufferHeight_(0),
271+ pbufferPixels_(0),
272+ minSwapInterval_(0),
273+ maxSwapInterval_(0),
274 nativeID_(0),
275 nativeType_(0),
276 nativeRenderable_(false),
277
278=== modified file 'src/gl-visual-config.cpp'
279--- src/gl-visual-config.cpp 2012-08-13 10:09:08 +0000
280+++ src/gl-visual-config.cpp 2012-12-06 18:00:32 +0000
281@@ -26,7 +26,7 @@
282 #include <vector>
283
284 GLVisualConfig::GLVisualConfig(const std::string &s) :
285- red(1), green(1), blue(1), alpha(1), depth(1), buffer(1)
286+ red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1)
287 {
288 std::vector<std::string> elems;
289
290@@ -50,6 +50,8 @@
291 alpha = Util::fromString<int>(opt[1]);
292 else if (opt[0] == "d" || opt[0] == "depth")
293 depth = Util::fromString<int>(opt[1]);
294+ else if (opt[0] == "s" || opt[0] == "stencil")
295+ stencil = Util::fromString<int>(opt[1]);
296 else if (opt[0] == "buf" || opt[0] == "buffer")
297 buffer = Util::fromString<int>(opt[1]);
298 }
299@@ -74,6 +76,7 @@
300 score += score_component(blue, target.blue, 4);
301 score += score_component(alpha, target.alpha, 4);
302 score += score_component(depth, target.depth, 1);
303+ score += score_component(stencil, target.stencil, 0);
304 score += score_component(buffer, target.buffer, 1);
305
306 return score;
307
308=== modified file 'src/gl-visual-config.h'
309--- src/gl-visual-config.h 2012-05-11 13:49:53 +0000
310+++ src/gl-visual-config.h 2012-12-06 18:00:32 +0000
311@@ -31,9 +31,9 @@
312 {
313 public:
314 GLVisualConfig():
315- red(1), green(1), blue(1), alpha(1), depth(1), buffer(1) {}
316- GLVisualConfig(int r, int g, int b, int a, int d, int buf):
317- red(r), green(g), blue(b), alpha(a), depth(d), buffer(buf) {}
318+ red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1) {}
319+ GLVisualConfig(int r, int g, int b, int a, int d, int s, int buf):
320+ red(r), green(g), blue(b), alpha(a), depth(d), stencil(s), buffer(buf) {}
321 GLVisualConfig(const std::string &s);
322
323 /**
324@@ -55,6 +55,7 @@
325 int blue;
326 int alpha;
327 int depth;
328+ int stencil;
329 int buffer;
330
331 private:

Subscribers

People subscribed via source and target branches

to all changes: