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
=== modified file 'android/src/org/linaro/glmark2/GLVisualConfig.java'
--- android/src/org/linaro/glmark2/GLVisualConfig.java 2012-07-04 14:27:42 +0000
+++ android/src/org/linaro/glmark2/GLVisualConfig.java 2012-12-06 18:00:32 +0000
@@ -26,12 +26,13 @@
26 */26 */
27class GLVisualConfig {27class GLVisualConfig {
28 public GLVisualConfig() {}28 public GLVisualConfig() {}
29 public GLVisualConfig(int r, int g, int b, int a, int d, int buf) {29 public GLVisualConfig(int r, int g, int b, int a, int d, int s, int buf) {
30 red = r;30 red = r;
31 green = g;31 green = g;
32 blue = b;32 blue = b;
33 alpha = a;33 alpha = a;
34 depth = d;34 depth = d;
35 stencil = s;
35 buffer = buf;36 buffer = buf;
36 }37 }
3738
@@ -40,5 +41,6 @@
40 public int blue;41 public int blue;
41 public int alpha;42 public int alpha;
42 public int depth;43 public int depth;
44 public int stencil;
43 public int buffer;45 public int buffer;
44}46}
4547
=== modified file 'android/src/org/linaro/glmark2/Glmark2SurfaceView.java'
--- android/src/org/linaro/glmark2/Glmark2SurfaceView.java 2012-07-30 12:28:16 +0000
+++ android/src/org/linaro/glmark2/Glmark2SurfaceView.java 2012-12-06 18:00:32 +0000
@@ -50,7 +50,7 @@
5050
51 /* Parse the config string parameters */51 /* Parse the config string parameters */
52 String[] configParams = configString.split(":");52 String[] configParams = configString.split(":");
53 GLVisualConfig targetConfig = new GLVisualConfig(5, 6, 5, 0, 16, 1);53 GLVisualConfig targetConfig = new GLVisualConfig(5, 6, 5, 0, 16, 0, 1);
5454
55 for (String param : configParams) {55 for (String param : configParams) {
56 String[] paramKeyValue = param.split("=");56 String[] paramKeyValue = param.split("=");
@@ -67,6 +67,8 @@
67 targetConfig.alpha = Integer.parseInt(paramKeyValue[1]);67 targetConfig.alpha = Integer.parseInt(paramKeyValue[1]);
68 else if (paramKeyValue[0].equals("depth") || paramKeyValue[0].equals("d"))68 else if (paramKeyValue[0].equals("depth") || paramKeyValue[0].equals("d"))
69 targetConfig.depth = Integer.parseInt(paramKeyValue[1]);69 targetConfig.depth = Integer.parseInt(paramKeyValue[1]);
70 else if (paramKeyValue[0].equals("stencil") || paramKeyValue[0].equals("s"))
71 targetConfig.stencil = Integer.parseInt(paramKeyValue[1]);
70 else if (paramKeyValue[0].equals("buffer") || paramKeyValue[0].equals("buf"))72 else if (paramKeyValue[0].equals("buffer") || paramKeyValue[0].equals("buf"))
71 targetConfig.buffer = Integer.parseInt(paramKeyValue[1]);73 targetConfig.buffer = Integer.parseInt(paramKeyValue[1]);
72 }74 }
@@ -89,6 +91,7 @@
89 EGL10.EGL_BLUE_SIZE, targetConfig.blue,91 EGL10.EGL_BLUE_SIZE, targetConfig.blue,
90 EGL10.EGL_ALPHA_SIZE, targetConfig.alpha,92 EGL10.EGL_ALPHA_SIZE, targetConfig.alpha,
91 EGL10.EGL_DEPTH_SIZE, targetConfig.depth,93 EGL10.EGL_DEPTH_SIZE, targetConfig.depth,
94 EGL10.EGL_STENCIL_SIZE, targetConfig.stencil,
92 EGL10.EGL_BUFFER_SIZE, targetConfig.buffer,95 EGL10.EGL_BUFFER_SIZE, targetConfig.buffer,
93 EGL10.EGL_RENDERABLE_TYPE, 4, /* 4 = EGL_OPENGL_ES2_BIT */96 EGL10.EGL_RENDERABLE_TYPE, 4, /* 4 = EGL_OPENGL_ES2_BIT */
94 EGL10.EGL_NONE };97 EGL10.EGL_NONE };
@@ -156,6 +159,8 @@
156 EGL10.EGL_ALPHA_SIZE, 0);159 EGL10.EGL_ALPHA_SIZE, 0);
157 vc.depth = findConfigAttrib(egl, display, config,160 vc.depth = findConfigAttrib(egl, display, config,
158 EGL10.EGL_DEPTH_SIZE, 0);161 EGL10.EGL_DEPTH_SIZE, 0);
162 vc.stencil = findConfigAttrib(egl, display, config,
163 EGL10.EGL_STENCIL_SIZE, 0);
159 vc.buffer = findConfigAttrib(egl, display, config,164 vc.buffer = findConfigAttrib(egl, display, config,
160 EGL10.EGL_BUFFER_SIZE, 0);165 EGL10.EGL_BUFFER_SIZE, 0);
161166
162167
=== modified file 'src/canvas-x11-glx.cpp'
--- src/canvas-x11-glx.cpp 2012-08-23 22:47:12 +0000
+++ src/canvas-x11-glx.cpp 2012-12-06 18:00:32 +0000
@@ -171,6 +171,7 @@
171 GLX_BLUE_SIZE, visual_config_.blue,171 GLX_BLUE_SIZE, visual_config_.blue,
172 GLX_ALPHA_SIZE, visual_config_.alpha,172 GLX_ALPHA_SIZE, visual_config_.alpha,
173 GLX_DEPTH_SIZE, visual_config_.depth,173 GLX_DEPTH_SIZE, visual_config_.depth,
174 GLX_STENCIL_SIZE, visual_config_.stencil,
174 GLX_BUFFER_SIZE, visual_config_.buffer,175 GLX_BUFFER_SIZE, visual_config_.buffer,
175 GLX_DOUBLEBUFFER, True,176 GLX_DOUBLEBUFFER, True,
176 None177 None
@@ -200,7 +201,7 @@
200 XFree(fbc);201 XFree(fbc);
201202
202 if (Options::show_debug) {203 if (Options::show_debug) {
203 int buf, red, green, blue, alpha, depth, id, native_id;204 int buf, red, green, blue, alpha, depth, stencil, id, native_id;
204 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_FBCONFIG_ID, &id);205 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_FBCONFIG_ID, &id);
205 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_VISUAL_ID, &native_id);206 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_VISUAL_ID, &native_id);
206 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BUFFER_SIZE, &buf);207 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BUFFER_SIZE, &buf);
@@ -209,15 +210,17 @@
209 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BLUE_SIZE, &blue);210 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BLUE_SIZE, &blue);
210 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_ALPHA_SIZE, &alpha);211 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_ALPHA_SIZE, &alpha);
211 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_DEPTH_SIZE, &depth);212 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_DEPTH_SIZE, &depth);
213 glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_STENCIL_SIZE, &stencil);
212 Log::debug("GLX chosen config ID: 0x%x Native Visual ID: 0x%x\n"214 Log::debug("GLX chosen config ID: 0x%x Native Visual ID: 0x%x\n"
213 " Buffer: %d bits\n"215 " Buffer: %d bits\n"
214 " Red: %d bits\n"216 " Red: %d bits\n"
215 " Green: %d bits\n"217 " Green: %d bits\n"
216 " Blue: %d bits\n"218 " Blue: %d bits\n"
217 " Alpha: %d bits\n"219 " Alpha: %d bits\n"
218 " Depth: %d bits\n",220 " Depth: %d bits\n"
221 " Stencil: %d bits\n",
219 id, native_id,222 id, native_id,
220 buf, red, green, blue, alpha, depth);223 buf, red, green, blue, alpha, depth, stencil);
221 }224 }
222225
223226
@@ -270,6 +273,7 @@
270 glXGetFBConfigAttrib(xdpy_, config, GLX_BLUE_SIZE, &visual_config.blue);273 glXGetFBConfigAttrib(xdpy_, config, GLX_BLUE_SIZE, &visual_config.blue);
271 glXGetFBConfigAttrib(xdpy_, config, GLX_ALPHA_SIZE, &visual_config.alpha);274 glXGetFBConfigAttrib(xdpy_, config, GLX_ALPHA_SIZE, &visual_config.alpha);
272 glXGetFBConfigAttrib(xdpy_, config, GLX_DEPTH_SIZE, &visual_config.depth);275 glXGetFBConfigAttrib(xdpy_, config, GLX_DEPTH_SIZE, &visual_config.depth);
276 glXGetFBConfigAttrib(xdpy_, config, GLX_STENCIL_SIZE, &visual_config.stencil);
273}277}
274278
275GLXFBConfig279GLXFBConfig
276280
=== modified file 'src/egl-state.cpp'
--- src/egl-state.cpp 2012-11-15 23:06:53 +0000
+++ src/egl-state.cpp 2012-12-06 18:00:32 +0000
@@ -38,10 +38,19 @@
38 luminanceSize_(0),38 luminanceSize_(0),
39 alphaSize_(0),39 alphaSize_(0),
40 alphaMaskSize_(0),40 alphaMaskSize_(0),
41 bindTexRGB_(false),
42 bindTexRGBA_(false),
41 bufferType_(EGL_RGB_BUFFER),43 bufferType_(EGL_RGB_BUFFER),
42 caveat_(0),44 caveat_(0),
43 configID_(0),45 configID_(0),
46 conformant_(0),
44 depthSize_(0),47 depthSize_(0),
48 level_(0),
49 pbufferWidth_(0),
50 pbufferHeight_(0),
51 pbufferPixels_(0),
52 minSwapInterval_(0),
53 maxSwapInterval_(0),
45 nativeID_(0),54 nativeID_(0),
46 nativeType_(0),55 nativeType_(0),
47 nativeRenderable_(false),56 nativeRenderable_(false),
@@ -63,6 +72,10 @@
63 {72 {
64 badAttribVec.push_back("EGL_CONFIG_CAVEAT");73 badAttribVec.push_back("EGL_CONFIG_CAVEAT");
65 }74 }
75 if (!eglGetConfigAttrib(dpy, handle_, EGL_CONFORMANT, &conformant_))
76 {
77 badAttribVec.push_back("EGL_CONFORMANT");
78 }
66 if (!eglGetConfigAttrib(dpy, handle_, EGL_COLOR_BUFFER_TYPE, &bufferType_))79 if (!eglGetConfigAttrib(dpy, handle_, EGL_COLOR_BUFFER_TYPE, &bufferType_))
67 {80 {
68 badAttribVec.push_back("EGL_COLOR_BUFFER_TYPE");81 badAttribVec.push_back("EGL_COLOR_BUFFER_TYPE");
@@ -98,6 +111,10 @@
98 {111 {
99 badAttribVec.push_back("EGL_ALPHA_SIZE");112 badAttribVec.push_back("EGL_ALPHA_SIZE");
100 }113 }
114 if (!eglGetConfigAttrib(dpy, handle_, EGL_ALPHA_MASK_SIZE, &alphaMaskSize_))
115 {
116 badAttribVec.push_back("EGL_ALPHA_MASK_SIZE");
117 }
101 if (!eglGetConfigAttrib(dpy, handle_, EGL_DEPTH_SIZE, &depthSize_))118 if (!eglGetConfigAttrib(dpy, handle_, EGL_DEPTH_SIZE, &depthSize_))
102 {119 {
103 badAttribVec.push_back("EGL_DEPTH_SIZE");120 badAttribVec.push_back("EGL_DEPTH_SIZE");
@@ -106,15 +123,47 @@
106 {123 {
107 badAttribVec.push_back("EGL_STENCIL_SIZE");124 badAttribVec.push_back("EGL_STENCIL_SIZE");
108 }125 }
126 EGLint doBind(EGL_FALSE);
127 if (!eglGetConfigAttrib(dpy, handle_, EGL_BIND_TO_TEXTURE_RGB, &doBind))
128 {
129 badAttribVec.push_back("EGL_BIND_TO_TEXTURE_RGB");
130 }
131 bindTexRGB_ = (doBind == EGL_TRUE);
132 if (!eglGetConfigAttrib(dpy, handle_, EGL_BIND_TO_TEXTURE_RGBA, &doBind))
133 {
134 badAttribVec.push_back("EGL_BIND_TO_TEXTURE_RGBA");
135 }
136 bindTexRGBA_ = (doBind == EGL_TRUE);
137 if (!eglGetConfigAttrib(dpy, handle_, EGL_LEVEL, &level_))
138 {
139 badAttribVec.push_back("EGL_LEVEL");
140 }
141 if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_WIDTH, &pbufferWidth_))
142 {
143 badAttribVec.push_back("EGL_MAX_PBUFFER_WIDTH");
144 }
145 if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_HEIGHT, &pbufferHeight_))
146 {
147 badAttribVec.push_back("EGL_MAX_PBUFFER_HEIGHT");
148 }
149 if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_PIXELS, &pbufferPixels_))
150 {
151 badAttribVec.push_back("EGL_MAX_PBUFFER_PIXELS");
152 }
153 if (!eglGetConfigAttrib(dpy, handle_, EGL_MIN_SWAP_INTERVAL, &minSwapInterval_))
154 {
155 badAttribVec.push_back("EGL_MIN_SWAP_INTERVAL");
156 }
157 if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_SWAP_INTERVAL, &maxSwapInterval_))
158 {
159 badAttribVec.push_back("EGL_MAX_SWAP_INTERVAL");
160 }
109 EGLint doNative(EGL_FALSE);161 EGLint doNative(EGL_FALSE);
110 if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_RENDERABLE, &doNative))162 if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_RENDERABLE, &doNative))
111 {163 {
112 badAttribVec.push_back("EGL_NATIVE_RENDERABLE");164 badAttribVec.push_back("EGL_NATIVE_RENDERABLE");
113 }165 }
114 if (doNative == EGL_TRUE)166 nativeRenderable_ = (doNative == EGL_TRUE);
115 {
116 nativeRenderable_ = true;
117 }
118 if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_VISUAL_TYPE, &nativeType_))167 if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_VISUAL_TYPE, &nativeType_))
119 {168 {
120 badAttribVec.push_back("EGL_NATIVE_VISUAL_TYPE");169 badAttribVec.push_back("EGL_NATIVE_VISUAL_TYPE");
@@ -293,6 +342,7 @@
293 eglGetConfigAttrib(egl_display_, config, EGL_BLUE_SIZE, &visual_config.blue);342 eglGetConfigAttrib(egl_display_, config, EGL_BLUE_SIZE, &visual_config.blue);
294 eglGetConfigAttrib(egl_display_, config, EGL_ALPHA_SIZE, &visual_config.alpha);343 eglGetConfigAttrib(egl_display_, config, EGL_ALPHA_SIZE, &visual_config.alpha);
295 eglGetConfigAttrib(egl_display_, config, EGL_DEPTH_SIZE, &visual_config.depth);344 eglGetConfigAttrib(egl_display_, config, EGL_DEPTH_SIZE, &visual_config.depth);
345 eglGetConfigAttrib(egl_display_, config, EGL_STENCIL_SIZE, &visual_config.stencil);
296}346}
297347
298EGLConfig348EGLConfig
@@ -341,6 +391,7 @@
341 EGL_BLUE_SIZE, visual_config_.blue,391 EGL_BLUE_SIZE, visual_config_.blue,
342 EGL_ALPHA_SIZE, visual_config_.alpha,392 EGL_ALPHA_SIZE, visual_config_.alpha,
343 EGL_DEPTH_SIZE, visual_config_.depth,393 EGL_DEPTH_SIZE, visual_config_.depth,
394 EGL_STENCIL_SIZE, visual_config_.stencil,
344#if USE_GLESv2395#if USE_GLESv2
345 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,396 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
346#elif USE_GL397#elif USE_GL
347398
=== modified file 'src/egl-state.h'
--- src/egl-state.h 2012-11-13 16:53:41 +0000
+++ src/egl-state.h 2012-12-06 18:00:32 +0000
@@ -37,12 +37,24 @@
37 EGLint luminanceSize_;37 EGLint luminanceSize_;
38 EGLint alphaSize_;38 EGLint alphaSize_;
39 EGLint alphaMaskSize_;39 EGLint alphaMaskSize_;
40 bool bindTexRGB_;
41 bool bindTexRGBA_;
40 EGLint bufferType_;42 EGLint bufferType_;
41 // Base config attributes43 // Base config attributes
42 EGLint caveat_;44 EGLint caveat_;
43 EGLint configID_;45 EGLint configID_;
46 EGLint conformant_;
44 // Depth buffer47 // Depth buffer
45 EGLint depthSize_;48 EGLint depthSize_;
49 // Framebuffer level
50 EGLint level_;
51 // Pbuffers
52 EGLint pbufferWidth_;
53 EGLint pbufferHeight_;
54 EGLint pbufferPixels_;
55 // Swap interval
56 EGLint minSwapInterval_;
57 EGLint maxSwapInterval_;
46 // Native window system attributes.58 // Native window system attributes.
47 EGLint nativeID_;59 EGLint nativeID_;
48 EGLint nativeType_;60 EGLint nativeType_;
@@ -69,10 +81,19 @@
69 luminanceSize_(0),81 luminanceSize_(0),
70 alphaSize_(0),82 alphaSize_(0),
71 alphaMaskSize_(0),83 alphaMaskSize_(0),
84 bindTexRGB_(false),
85 bindTexRGBA_(false),
72 bufferType_(EGL_RGB_BUFFER),86 bufferType_(EGL_RGB_BUFFER),
73 caveat_(0),87 caveat_(0),
74 configID_(0),88 configID_(0),
89 conformant_(0),
75 depthSize_(0),90 depthSize_(0),
91 level_(0),
92 pbufferWidth_(0),
93 pbufferHeight_(0),
94 pbufferPixels_(0),
95 minSwapInterval_(0),
96 maxSwapInterval_(0),
76 nativeID_(0),97 nativeID_(0),
77 nativeType_(0),98 nativeType_(0),
78 nativeRenderable_(false),99 nativeRenderable_(false),
79100
=== modified file 'src/gl-visual-config.cpp'
--- src/gl-visual-config.cpp 2012-08-13 10:09:08 +0000
+++ src/gl-visual-config.cpp 2012-12-06 18:00:32 +0000
@@ -26,7 +26,7 @@
26#include <vector>26#include <vector>
2727
28GLVisualConfig::GLVisualConfig(const std::string &s) :28GLVisualConfig::GLVisualConfig(const std::string &s) :
29 red(1), green(1), blue(1), alpha(1), depth(1), buffer(1)29 red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1)
30{30{
31 std::vector<std::string> elems;31 std::vector<std::string> elems;
3232
@@ -50,6 +50,8 @@
50 alpha = Util::fromString<int>(opt[1]);50 alpha = Util::fromString<int>(opt[1]);
51 else if (opt[0] == "d" || opt[0] == "depth")51 else if (opt[0] == "d" || opt[0] == "depth")
52 depth = Util::fromString<int>(opt[1]);52 depth = Util::fromString<int>(opt[1]);
53 else if (opt[0] == "s" || opt[0] == "stencil")
54 stencil = Util::fromString<int>(opt[1]);
53 else if (opt[0] == "buf" || opt[0] == "buffer")55 else if (opt[0] == "buf" || opt[0] == "buffer")
54 buffer = Util::fromString<int>(opt[1]);56 buffer = Util::fromString<int>(opt[1]);
55 }57 }
@@ -74,6 +76,7 @@
74 score += score_component(blue, target.blue, 4);76 score += score_component(blue, target.blue, 4);
75 score += score_component(alpha, target.alpha, 4);77 score += score_component(alpha, target.alpha, 4);
76 score += score_component(depth, target.depth, 1);78 score += score_component(depth, target.depth, 1);
79 score += score_component(stencil, target.stencil, 0);
77 score += score_component(buffer, target.buffer, 1);80 score += score_component(buffer, target.buffer, 1);
7881
79 return score;82 return score;
8083
=== modified file 'src/gl-visual-config.h'
--- src/gl-visual-config.h 2012-05-11 13:49:53 +0000
+++ src/gl-visual-config.h 2012-12-06 18:00:32 +0000
@@ -31,9 +31,9 @@
31{31{
32public:32public:
33 GLVisualConfig():33 GLVisualConfig():
34 red(1), green(1), blue(1), alpha(1), depth(1), buffer(1) {}34 red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1) {}
35 GLVisualConfig(int r, int g, int b, int a, int d, int buf):35 GLVisualConfig(int r, int g, int b, int a, int d, int s, int buf):
36 red(r), green(g), blue(b), alpha(a), depth(d), buffer(buf) {}36 red(r), green(g), blue(b), alpha(a), depth(d), stencil(s), buffer(buf) {}
37 GLVisualConfig(const std::string &s);37 GLVisualConfig(const std::string &s);
3838
39 /**39 /**
@@ -55,6 +55,7 @@
55 int blue;55 int blue;
56 int alpha;56 int alpha;
57 int depth;57 int depth;
58 int stencil;
58 int buffer;59 int buffer;
5960
60private:61private:

Subscribers

People subscribed via source and target branches

to all changes: