From patchwork Thu Dec 6 18:16:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barker X-Patchwork-Id: 13397 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 597E14C15B0 for ; Thu, 6 Dec 2012 18:35:37 +0000 (UTC) Received: from mail-ia0-f170.google.com (mail-ia0-f170.google.com [209.85.210.170]) by fiordland.canonical.com (Postfix) with ESMTP id 7B8C0A1A028 for ; Thu, 6 Dec 2012 18:35:35 +0000 (UTC) Received: by mail-ia0-f170.google.com with SMTP id i1so4238952iaa.29 for ; Thu, 06 Dec 2012 10:35:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=OSfHUQ50QW5K6iXHRQKcT9b6jgB3Itsz6QEyYbOf4Oo=; b=XM5RZYw2B3QHqOP26qe346Dhl8DwoVKCCE4esyFt0jfNeROzuCFfwn8lQjBSR5jzzJ FPaaK0lrQDQ1NbHazKKftK1MhUUz+mwQkhNs6jgUfAKmEOPa4/IgQ39TijEi0hJ52gw4 DvNhQeXouITggIFzP+73PvXaN5iSfs0JdrcoLz6pqTM6ywGaZKVzRuBhCDNYTr7Z9bch 2m6Ap0uZzPpOXWV6VauYt9tQ8rTcb7kD5knU17JM6gOwqN74BMwuxq+aN7yVbHUowHcN H2seKZ+6cGqTRxDQ5gtiCXaS6EasbuuBcYOqFRznl9c+yHdyJYrH20AbSEESYiCg43Sm HqzA== Received: by 10.50.152.137 with SMTP id uy9mr2420972igb.62.1354818934962; Thu, 06 Dec 2012 10:35:34 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp427234igt; Thu, 6 Dec 2012 10:35:34 -0800 (PST) Received: by 10.180.72.232 with SMTP id g8mr10542191wiv.0.1354818933628; Thu, 06 Dec 2012 10:35:33 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id q3si11742061wic.2.2012.12.06.10.35.32 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Dec 2012 10:35:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1TggIF-0004Uv-Uk for ; Thu, 06 Dec 2012 18:35:31 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 260BEE078C for ; Thu, 6 Dec 2012 18:16:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 253 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 253: Merge of lp:~glmark2-dev/glmark2/config-update. Message-Id: <20121206181613.7348.77640.launchpad@ackee.canonical.com> Date: Thu, 06 Dec 2012 18:16:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16341"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 1b40cf3d813b18a2c4e4e9410e1fdf5b2b729b00 X-Gm-Message-State: ALoCoQk/znF3aTjipS3QPXNZMH75felECUIzluXmsPJrHKrL1JZYZbw0Susv4GnvrfCx9pusjoeb Merge authors: Alexandros Frantzis (afrantzis) Jesse Barker (jesse-barker) Related merge proposals: https://code.launchpad.net/~glmark2-dev/glmark2/config-update/+merge/138342 proposed by: Jesse Barker (jesse-barker) review: Approve - Alexandros Frantzis (afrantzis) ------------------------------------------------------------ revno: 253 [merge] committer: Jesse Barker branch nick: trunk timestamp: Thu 2012-12-06 10:13:53 -0800 message: Merge of lp:~glmark2-dev/glmark2/config-update. Enhances GLVisualConfig to support the stencil attribute (defaults to prefer no stencil buffer configs). Updates EglConfig to query for all of table 3.1 in the EGL 1.4 spec. modified: android/src/org/linaro/glmark2/GLVisualConfig.java android/src/org/linaro/glmark2/Glmark2SurfaceView.java src/canvas-x11-glx.cpp src/egl-state.cpp src/egl-state.h src/gl-visual-config.cpp src/gl-visual-config.h --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === 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-05 23:50:25 +0000 @@ -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' --- android/src/org/linaro/glmark2/Glmark2SurfaceView.java 2012-07-30 12:28:16 +0000 +++ android/src/org/linaro/glmark2/Glmark2SurfaceView.java 2012-12-05 23:50:25 +0000 @@ -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' --- src/canvas-x11-glx.cpp 2012-08-23 22:47:12 +0000 +++ src/canvas-x11-glx.cpp 2012-12-06 17:54:57 +0000 @@ -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' --- src/egl-state.cpp 2012-11-15 23:06:53 +0000 +++ src/egl-state.cpp 2012-12-05 23:50:25 +0000 @@ -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' --- src/egl-state.h 2012-11-13 16:53:41 +0000 +++ src/egl-state.h 2012-12-05 22:19:12 +0000 @@ -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' --- src/gl-visual-config.cpp 2012-08-13 10:09:08 +0000 +++ src/gl-visual-config.cpp 2012-12-05 23:50:25 +0000 @@ -26,7 +26,7 @@ #include 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 elems; @@ -50,6 +50,8 @@ alpha = Util::fromString(opt[1]); else if (opt[0] == "d" || opt[0] == "depth") depth = Util::fromString(opt[1]); + else if (opt[0] == "s" || opt[0] == "stencil") + stencil = Util::fromString(opt[1]); else if (opt[0] == "buf" || opt[0] == "buffer") buffer = Util::fromString(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' --- src/gl-visual-config.h 2012-05-11 13:49:53 +0000 +++ src/gl-visual-config.h 2012-12-05 23:50:25 +0000 @@ -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: