forked from enlightenment/efl
glx: Fix black windows in E on nvidia
This fixes calls to glXCreatePixmap that would consistently fail on nvidia >= 360. It seems glXCreatePixmapEXT was used instead of glXCreatePixmap, and that function always returned 0. One could assume always using the non-EXT version of the function should be preferred. Unfortunately, doing so for all the other functions brings back the black windows. I'm taking a very careful approach by doing this only for drivers >= 360. Fixes T3030 @fix
This commit is contained in:
parent
444ab8fb17
commit
19eb7b727f
|
@ -1330,13 +1330,15 @@ gl_symbols(void)
|
|||
}
|
||||
|
||||
void
|
||||
eng_gl_symbols(void)
|
||||
eng_gl_symbols(Eina_Bool noext_glXCreatePixmap)
|
||||
{
|
||||
static int done = 0;
|
||||
|
||||
if (done) return;
|
||||
|
||||
#ifdef GL_GLES
|
||||
(void) noext_glXCreatePixmap;
|
||||
|
||||
#define FINDSYM(dst, sym, typ) \
|
||||
if (glsym_eglGetProcAddress) { \
|
||||
if (!dst) dst = (typ)glsym_eglGetProcAddress(sym); \
|
||||
|
@ -1374,6 +1376,16 @@ eng_gl_symbols(void)
|
|||
|
||||
glsym_evas_gl_symbols((void*)glsym_glXGetProcAddress);
|
||||
|
||||
if (noext_glXCreatePixmap)
|
||||
{
|
||||
/* Note for nvidia >= 360:
|
||||
* glXBindTexImage{EXT,ARB} should be preferred over glXBindTexImage
|
||||
* glXCreatePixmap should be preferred over glXCreatePixmap{EXT,ARB}
|
||||
*/
|
||||
FINDSYM(glsym_glXCreatePixmap, "glXCreatePixmap", glsym_func_xid);
|
||||
FINDSYM(glsym_glXDestroyPixmap, "glXDestroyPixmap", glsym_func_void);
|
||||
}
|
||||
|
||||
FINDSYM(glsym_glXBindTexImage, "glXBindTexImageEXT", glsym_func_void);
|
||||
FINDSYM(glsym_glXBindTexImage, "glXBindTexImageARB", glsym_func_void);
|
||||
FINDSYM(glsym_glXBindTexImage, "glXBindTexImage", glsym_func_void);
|
||||
|
|
|
@ -76,6 +76,7 @@ struct _Outbuf
|
|||
unsigned char msaa;
|
||||
#ifndef GL_GLES
|
||||
Eina_Bool loose_binding : 1;
|
||||
Eina_Bool noext_glXCreatePixmap : 1;
|
||||
#endif
|
||||
} detected;
|
||||
|
||||
|
@ -199,7 +200,7 @@ Evas_Engine_GL_Context *eng_outbuf_gl_context_get(Outbuf *ob);
|
|||
void *eng_outbuf_egl_display_get(Outbuf *ob);
|
||||
|
||||
Eina_Bool eng_preload_make_current(void *data, void *doit);
|
||||
void eng_gl_symbols(void);
|
||||
void eng_gl_symbols(Eina_Bool noext_glXCreatePixmap);
|
||||
|
||||
static inline int
|
||||
_re_wincheck(Outbuf *ob)
|
||||
|
|
|
@ -542,6 +542,7 @@ try_gles2:
|
|||
// ALSO as of some nvidia driver version loose binding is
|
||||
// probably not needed
|
||||
if (v1 < 195) gw->detected.loose_binding = 1;
|
||||
if (v1 >= 360) gw->detected.noext_glXCreatePixmap = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -557,7 +558,7 @@ try_gles2:
|
|||
gw->detected.msaa = val;
|
||||
#endif
|
||||
|
||||
eng_gl_symbols();
|
||||
eng_gl_symbols(gw->detected.noext_glXCreatePixmap);
|
||||
gw->gl_context = glsym_evas_gl_common_context_new();
|
||||
if (!gw->gl_context)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue