add checks for vendor etc. too

SVN revision: 46176
This commit is contained in:
Carsten Haitzler 2010-02-15 04:12:50 +00:00
parent 7c1420c73b
commit b933154d21
4 changed files with 27 additions and 3 deletions

View 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;

View 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;

View 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
};

View 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++)
{