diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 61: Request non-zero sizes for the rgb components of the color buffer and the depth buffer when creat...

Message ID 20110721123634.17019.73189.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org July 21, 2011, 12:36 p.m. UTC
------------------------------------------------------------
revno: 61
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
timestamp: Fri 2010-11-19 13:54:36 +0200
message:
  Request non-zero sizes for the rgb components of the color buffer and the depth buffer when creating the EGL context.
  This makes sure we get sane values for them (eg that we actually get a depth buffer!).
modified:
  src/screen-sdl-glesv2.cpp
  src/sdlgles/attribs.inc


--
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
diff mbox

Patch

=== modified file 'src/screen-sdl-glesv2.cpp'
--- src/screen-sdl-glesv2.cpp	2010-07-13 10:22:05 +0000
+++ src/screen-sdl-glesv2.cpp	2010-11-19 11:54:36 +0000
@@ -44,6 +44,26 @@ 
 	return;
     }
 
+#ifdef _DEBUG
+    {
+    int buf, red, green, blue, alpha, depth;
+    SDL_GLES_GetAttribute(SDL_GLES_BUFFER_SIZE, &buf);
+    SDL_GLES_GetAttribute(SDL_GLES_RED_SIZE, &red);
+    SDL_GLES_GetAttribute(SDL_GLES_GREEN_SIZE, &green);
+    SDL_GLES_GetAttribute(SDL_GLES_BLUE_SIZE, &blue);
+    SDL_GLES_GetAttribute(SDL_GLES_ALPHA_SIZE, &alpha);
+    SDL_GLES_GetAttribute(SDL_GLES_DEPTH_SIZE, &depth);
+    printf("EGL chosen config:\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",
+           buf, red, green, blue, alpha, depth);
+    }
+#endif
+
     glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
     glEnable(GL_DEPTH_TEST);
     glDepthFunc(GL_LEQUAL);

=== modified file 'src/sdlgles/attribs.inc'
--- src/sdlgles/attribs.inc	2010-07-12 13:37:04 +0000
+++ src/sdlgles/attribs.inc	2010-11-19 11:54:36 +0000
@@ -1,13 +1,13 @@ 
 /* List of EGL attributes we care about */
-A(0,	EGL_BUFFER_SIZE,			0)
-A(1,	EGL_RED_SIZE,				0)
-A(2,	EGL_GREEN_SIZE,				0)
-A(3,	EGL_BLUE_SIZE,				0)
+A(0,	EGL_BUFFER_SIZE,			1)
+A(1,	EGL_RED_SIZE,				1)
+A(2,	EGL_GREEN_SIZE,				1)
+A(3,	EGL_BLUE_SIZE,				1)
 A(4,	EGL_LUMINANCE_SIZE,			0)
 A(5,	EGL_ALPHA_SIZE,				0)
 A(6,	EGL_CONFIG_CAVEAT,			EGL_DONT_CARE)
 A(7,	EGL_CONFIG_ID,				EGL_DONT_CARE)
-A(8,	EGL_DEPTH_SIZE,				0)
+A(8,	EGL_DEPTH_SIZE,				1)
 A(9,	EGL_LEVEL,					0)
 A(10,	EGL_NATIVE_RENDERABLE,		EGL_DONT_CARE)
 A(11,	EGL_NATIVE_VISUAL_TYPE,		EGL_DONT_CARE)