add checks for vendor etc. too
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 15 Feb 2010 04:12:50 +0000 (04:12 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 15 Feb 2010 04:12:50 +0000 (04:12 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@46176 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/gl_common/evas_gl_context.c
src/modules/engines/gl_x11/evas_engine.c
src/modules/engines/gl_x11/evas_engine.h
src/modules/engines/gl_x11/evas_x_main.c

index b661f48..87ae505 100644 (file)
@@ -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;
index 4a61bf2..124cd8d 100644 (file)
@@ -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;
index a8db705..9685f93 100644 (file)
@@ -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
 
 };
index 60a6105..50b4a1c 100644 (file)
@@ -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++)
           {