From: raster Date: Mon, 15 Feb 2010 04:12:50 +0000 (+0000) Subject: add checks for vendor etc. too X-Git-Tag: 2.0_alpha~240^2~2039 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60dcd2d143ea99bc361d46eb7178bcbea50d3c3e;p=framework%2Fuifw%2Fevas.git add checks for vendor etc. too git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@46176 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/engines/gl_common/evas_gl_context.c b/src/modules/engines/gl_common/evas_gl_context.c index b661f48..87ae505 100644 --- a/src/modules/engines/gl_common/evas_gl_context.c +++ b/src/modules/engines/gl_common/evas_gl_context.c @@ -165,7 +165,6 @@ evas_gl_common_context_new(void) { Evas_GL_Context *gc; - gl_symbols(); #if 1 if (_evas_gl_common_context) { @@ -176,6 +175,8 @@ evas_gl_common_context_new(void) gc = calloc(1, sizeof(Evas_GL_Context)); if (!gc) return NULL; + gl_symbols(); + gc->references = 1; _evas_gl_common_context = gc; diff --git a/src/modules/engines/gl_x11/evas_engine.c b/src/modules/engines/gl_x11/evas_engine.c index 4a61bf2..124cd8d 100644 --- a/src/modules/engines/gl_x11/evas_engine.c +++ b/src/modules/engines/gl_x11/evas_engine.c @@ -1348,8 +1348,7 @@ eng_image_native_set(void *data, void *image, void *native) n->visual = vis; n->fbc = re->win->depth_cfg[depth].fbc; im->native.yinvert = re->win->depth_cfg[depth].yinvert; -// im->native.loose = 1; // works well on nvidia - intel may not be happy i hear. for now.. lets make nv work 1. - because i have an nv card, 2. because it doesnt seem broken for texture-from-pixmap like fglrx has seemed, 3. its some of the best done drivers on linux - im->native.loose = 0; + im->native.loose = re->win->detected.loose_binding; im->native.data = n; im->native.func.data = re; im->native.func.bind = _native_bind_cb; diff --git a/src/modules/engines/gl_x11/evas_engine.h b/src/modules/engines/gl_x11/evas_engine.h index a8db705..9685f93 100644 --- a/src/modules/engines/gl_x11/evas_engine.h +++ b/src/modules/engines/gl_x11/evas_engine.h @@ -101,6 +101,10 @@ struct _Evas_GL_X11_Window int mipmap; unsigned char yinvert : 1; } depth_cfg[33]; // config for all 32 possible depths! + + struct { + unsigned int loose_binding : 1; + } detected; #endif }; diff --git a/src/modules/engines/gl_x11/evas_x_main.c b/src/modules/engines/gl_x11/evas_x_main.c index 60a6105..50b4a1c 100644 --- a/src/modules/engines/gl_x11/evas_x_main.c +++ b/src/modules/engines/gl_x11/evas_x_main.c @@ -155,9 +155,29 @@ eng_window_new(Display *disp, { int i, j, num; GLXFBConfig *fbc; + const GLubyte *vendor, *renderer, *version; glXMakeCurrent(gw->disp, gw->win, gw->context); + // FIXME: move this up to context creation + + vendor = glGetString(GL_VENDOR); + renderer = glGetString(GL_RENDERER); + version = glGetString(GL_VERSION); + + printf("vendor: %s\n", vendor); + printf("renderer: %s\n", renderer); + printf("version: %s\n", version); + + if (strstr(vendor, "NVIDIA")) + { + gw->detected.loose_binding = 1; + } + else + { + // noothing yet. add more cases and options over time + } + fbc = glXGetFBConfigs(disp, 0/* FIXME: assume screen 0 */, &num); for (i = 0; i <= 32; i++) {