=== modified file 'android/src/org/linaro/glmark2/GLVisualConfig.java'
@@ -26,12 +26,13 @@
*/
class GLVisualConfig {
public GLVisualConfig() {}
- public GLVisualConfig(int r, int g, int b, int a, int d, int buf) {
+ public GLVisualConfig(int r, int g, int b, int a, int d, int s, int buf) {
red = r;
green = g;
blue = b;
alpha = a;
depth = d;
+ stencil = s;
buffer = buf;
}
@@ -40,5 +41,6 @@
public int blue;
public int alpha;
public int depth;
+ public int stencil;
public int buffer;
}
=== modified file 'android/src/org/linaro/glmark2/Glmark2SurfaceView.java'
@@ -50,7 +50,7 @@
/* Parse the config string parameters */
String[] configParams = configString.split(":");
- GLVisualConfig targetConfig = new GLVisualConfig(5, 6, 5, 0, 16, 1);
+ GLVisualConfig targetConfig = new GLVisualConfig(5, 6, 5, 0, 16, 0, 1);
for (String param : configParams) {
String[] paramKeyValue = param.split("=");
@@ -67,6 +67,8 @@
targetConfig.alpha = Integer.parseInt(paramKeyValue[1]);
else if (paramKeyValue[0].equals("depth") || paramKeyValue[0].equals("d"))
targetConfig.depth = Integer.parseInt(paramKeyValue[1]);
+ else if (paramKeyValue[0].equals("stencil") || paramKeyValue[0].equals("s"))
+ targetConfig.stencil = Integer.parseInt(paramKeyValue[1]);
else if (paramKeyValue[0].equals("buffer") || paramKeyValue[0].equals("buf"))
targetConfig.buffer = Integer.parseInt(paramKeyValue[1]);
}
@@ -89,6 +91,7 @@
EGL10.EGL_BLUE_SIZE, targetConfig.blue,
EGL10.EGL_ALPHA_SIZE, targetConfig.alpha,
EGL10.EGL_DEPTH_SIZE, targetConfig.depth,
+ EGL10.EGL_STENCIL_SIZE, targetConfig.stencil,
EGL10.EGL_BUFFER_SIZE, targetConfig.buffer,
EGL10.EGL_RENDERABLE_TYPE, 4, /* 4 = EGL_OPENGL_ES2_BIT */
EGL10.EGL_NONE };
@@ -156,6 +159,8 @@
EGL10.EGL_ALPHA_SIZE, 0);
vc.depth = findConfigAttrib(egl, display, config,
EGL10.EGL_DEPTH_SIZE, 0);
+ vc.stencil = findConfigAttrib(egl, display, config,
+ EGL10.EGL_STENCIL_SIZE, 0);
vc.buffer = findConfigAttrib(egl, display, config,
EGL10.EGL_BUFFER_SIZE, 0);
=== modified file 'src/canvas-x11-glx.cpp'
@@ -171,6 +171,7 @@
GLX_BLUE_SIZE, visual_config_.blue,
GLX_ALPHA_SIZE, visual_config_.alpha,
GLX_DEPTH_SIZE, visual_config_.depth,
+ GLX_STENCIL_SIZE, visual_config_.stencil,
GLX_BUFFER_SIZE, visual_config_.buffer,
GLX_DOUBLEBUFFER, True,
None
@@ -200,7 +201,7 @@
XFree(fbc);
if (Options::show_debug) {
- int buf, red, green, blue, alpha, depth, id, native_id;
+ int buf, red, green, blue, alpha, depth, stencil, id, native_id;
glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_FBCONFIG_ID, &id);
glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_VISUAL_ID, &native_id);
glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BUFFER_SIZE, &buf);
@@ -209,15 +210,17 @@
glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_BLUE_SIZE, &blue);
glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_ALPHA_SIZE, &alpha);
glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_DEPTH_SIZE, &depth);
+ glXGetFBConfigAttrib(xdpy_, glx_fbconfig_, GLX_STENCIL_SIZE, &stencil);
Log::debug("GLX chosen config ID: 0x%x Native Visual ID: 0x%x\n"
" Buffer: %d bits\n"
" Red: %d bits\n"
" Green: %d bits\n"
" Blue: %d bits\n"
" Alpha: %d bits\n"
- " Depth: %d bits\n",
+ " Depth: %d bits\n"
+ " Stencil: %d bits\n",
id, native_id,
- buf, red, green, blue, alpha, depth);
+ buf, red, green, blue, alpha, depth, stencil);
}
@@ -270,6 +273,7 @@
glXGetFBConfigAttrib(xdpy_, config, GLX_BLUE_SIZE, &visual_config.blue);
glXGetFBConfigAttrib(xdpy_, config, GLX_ALPHA_SIZE, &visual_config.alpha);
glXGetFBConfigAttrib(xdpy_, config, GLX_DEPTH_SIZE, &visual_config.depth);
+ glXGetFBConfigAttrib(xdpy_, config, GLX_STENCIL_SIZE, &visual_config.stencil);
}
GLXFBConfig
=== modified file 'src/egl-state.cpp'
@@ -38,10 +38,19 @@
luminanceSize_(0),
alphaSize_(0),
alphaMaskSize_(0),
+ bindTexRGB_(false),
+ bindTexRGBA_(false),
bufferType_(EGL_RGB_BUFFER),
caveat_(0),
configID_(0),
+ conformant_(0),
depthSize_(0),
+ level_(0),
+ pbufferWidth_(0),
+ pbufferHeight_(0),
+ pbufferPixels_(0),
+ minSwapInterval_(0),
+ maxSwapInterval_(0),
nativeID_(0),
nativeType_(0),
nativeRenderable_(false),
@@ -63,6 +72,10 @@
{
badAttribVec.push_back("EGL_CONFIG_CAVEAT");
}
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_CONFORMANT, &conformant_))
+ {
+ badAttribVec.push_back("EGL_CONFORMANT");
+ }
if (!eglGetConfigAttrib(dpy, handle_, EGL_COLOR_BUFFER_TYPE, &bufferType_))
{
badAttribVec.push_back("EGL_COLOR_BUFFER_TYPE");
@@ -98,6 +111,10 @@
{
badAttribVec.push_back("EGL_ALPHA_SIZE");
}
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_ALPHA_MASK_SIZE, &alphaMaskSize_))
+ {
+ badAttribVec.push_back("EGL_ALPHA_MASK_SIZE");
+ }
if (!eglGetConfigAttrib(dpy, handle_, EGL_DEPTH_SIZE, &depthSize_))
{
badAttribVec.push_back("EGL_DEPTH_SIZE");
@@ -106,15 +123,47 @@
{
badAttribVec.push_back("EGL_STENCIL_SIZE");
}
+ EGLint doBind(EGL_FALSE);
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_BIND_TO_TEXTURE_RGB, &doBind))
+ {
+ badAttribVec.push_back("EGL_BIND_TO_TEXTURE_RGB");
+ }
+ bindTexRGB_ = (doBind == EGL_TRUE);
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_BIND_TO_TEXTURE_RGBA, &doBind))
+ {
+ badAttribVec.push_back("EGL_BIND_TO_TEXTURE_RGBA");
+ }
+ bindTexRGBA_ = (doBind == EGL_TRUE);
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_LEVEL, &level_))
+ {
+ badAttribVec.push_back("EGL_LEVEL");
+ }
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_WIDTH, &pbufferWidth_))
+ {
+ badAttribVec.push_back("EGL_MAX_PBUFFER_WIDTH");
+ }
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_HEIGHT, &pbufferHeight_))
+ {
+ badAttribVec.push_back("EGL_MAX_PBUFFER_HEIGHT");
+ }
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_PBUFFER_PIXELS, &pbufferPixels_))
+ {
+ badAttribVec.push_back("EGL_MAX_PBUFFER_PIXELS");
+ }
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MIN_SWAP_INTERVAL, &minSwapInterval_))
+ {
+ badAttribVec.push_back("EGL_MIN_SWAP_INTERVAL");
+ }
+ if (!eglGetConfigAttrib(dpy, handle_, EGL_MAX_SWAP_INTERVAL, &maxSwapInterval_))
+ {
+ badAttribVec.push_back("EGL_MAX_SWAP_INTERVAL");
+ }
EGLint doNative(EGL_FALSE);
if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_RENDERABLE, &doNative))
{
badAttribVec.push_back("EGL_NATIVE_RENDERABLE");
}
- if (doNative == EGL_TRUE)
- {
- nativeRenderable_ = true;
- }
+ nativeRenderable_ = (doNative == EGL_TRUE);
if (!eglGetConfigAttrib(dpy, handle_, EGL_NATIVE_VISUAL_TYPE, &nativeType_))
{
badAttribVec.push_back("EGL_NATIVE_VISUAL_TYPE");
@@ -293,6 +342,7 @@
eglGetConfigAttrib(egl_display_, config, EGL_BLUE_SIZE, &visual_config.blue);
eglGetConfigAttrib(egl_display_, config, EGL_ALPHA_SIZE, &visual_config.alpha);
eglGetConfigAttrib(egl_display_, config, EGL_DEPTH_SIZE, &visual_config.depth);
+ eglGetConfigAttrib(egl_display_, config, EGL_STENCIL_SIZE, &visual_config.stencil);
}
EGLConfig
@@ -341,6 +391,7 @@
EGL_BLUE_SIZE, visual_config_.blue,
EGL_ALPHA_SIZE, visual_config_.alpha,
EGL_DEPTH_SIZE, visual_config_.depth,
+ EGL_STENCIL_SIZE, visual_config_.stencil,
#if USE_GLESv2
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
#elif USE_GL
=== modified file 'src/egl-state.h'
@@ -37,12 +37,24 @@
EGLint luminanceSize_;
EGLint alphaSize_;
EGLint alphaMaskSize_;
+ bool bindTexRGB_;
+ bool bindTexRGBA_;
EGLint bufferType_;
// Base config attributes
EGLint caveat_;
EGLint configID_;
+ EGLint conformant_;
// Depth buffer
EGLint depthSize_;
+ // Framebuffer level
+ EGLint level_;
+ // Pbuffers
+ EGLint pbufferWidth_;
+ EGLint pbufferHeight_;
+ EGLint pbufferPixels_;
+ // Swap interval
+ EGLint minSwapInterval_;
+ EGLint maxSwapInterval_;
// Native window system attributes.
EGLint nativeID_;
EGLint nativeType_;
@@ -69,10 +81,19 @@
luminanceSize_(0),
alphaSize_(0),
alphaMaskSize_(0),
+ bindTexRGB_(false),
+ bindTexRGBA_(false),
bufferType_(EGL_RGB_BUFFER),
caveat_(0),
configID_(0),
+ conformant_(0),
depthSize_(0),
+ level_(0),
+ pbufferWidth_(0),
+ pbufferHeight_(0),
+ pbufferPixels_(0),
+ minSwapInterval_(0),
+ maxSwapInterval_(0),
nativeID_(0),
nativeType_(0),
nativeRenderable_(false),
=== modified file 'src/gl-visual-config.cpp'
@@ -26,7 +26,7 @@
#include <vector>
GLVisualConfig::GLVisualConfig(const std::string &s) :
- red(1), green(1), blue(1), alpha(1), depth(1), buffer(1)
+ red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1)
{
std::vector<std::string> elems;
@@ -50,6 +50,8 @@
alpha = Util::fromString<int>(opt[1]);
else if (opt[0] == "d" || opt[0] == "depth")
depth = Util::fromString<int>(opt[1]);
+ else if (opt[0] == "s" || opt[0] == "stencil")
+ stencil = Util::fromString<int>(opt[1]);
else if (opt[0] == "buf" || opt[0] == "buffer")
buffer = Util::fromString<int>(opt[1]);
}
@@ -74,6 +76,7 @@
score += score_component(blue, target.blue, 4);
score += score_component(alpha, target.alpha, 4);
score += score_component(depth, target.depth, 1);
+ score += score_component(stencil, target.stencil, 0);
score += score_component(buffer, target.buffer, 1);
return score;
=== modified file 'src/gl-visual-config.h'
@@ -31,9 +31,9 @@
{
public:
GLVisualConfig():
- red(1), green(1), blue(1), alpha(1), depth(1), buffer(1) {}
- GLVisualConfig(int r, int g, int b, int a, int d, int buf):
- red(r), green(g), blue(b), alpha(a), depth(d), buffer(buf) {}
+ red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1) {}
+ GLVisualConfig(int r, int g, int b, int a, int d, int s, int buf):
+ red(r), green(g), blue(b), alpha(a), depth(d), stencil(s), buffer(buf) {}
GLVisualConfig(const std::string &s);
/**
@@ -55,6 +55,7 @@
int blue;
int alpha;
int depth;
+ int stencil;
int buffer;
private: