forked from enlightenment/efl
and this fixes compositing on newest intel+mesa drivers... wrong fb
config wasa being chosen as it was done by hand not accounting for multisample buffers. now using glxchoosefbconfig instead and it works. SVN revision: 79232
This commit is contained in:
parent
630d662a3b
commit
463614021a
73
ChangeLog
73
ChangeLog
|
@ -1,3 +1,42 @@
|
||||||
|
2012-11-13 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* Fixed GLX native surface handling to use glXChooseFBConfig.
|
||||||
|
This frixes a break in compositing on new intel mesa drivers.
|
||||||
|
|
||||||
|
2012-11-12 Mike Blumenkrantz
|
||||||
|
|
||||||
|
* Add eina_list_last_data_get
|
||||||
|
|
||||||
|
2012-11-10 Vincent Torri
|
||||||
|
|
||||||
|
* Fix build of eina_file on Solaris 10
|
||||||
|
|
||||||
|
2012-11-09 Vincent Torri
|
||||||
|
|
||||||
|
* Fixed longstanding memset bug in evas box.
|
||||||
|
|
||||||
|
2012-10-19 Cedric Bail
|
||||||
|
|
||||||
|
* Add eina_thread API.
|
||||||
|
|
||||||
|
2012-10-19 Patryk Kaczmarek
|
||||||
|
|
||||||
|
* eina_stringshare_add_length return NULL when func args are wrong.
|
||||||
|
|
||||||
|
2012-10-17 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* Add eina_barrier API to cover pthread_barrier functionality
|
||||||
|
* Add eina_tmpstr_add() and eina_tmpstr_del().
|
||||||
|
|
||||||
|
2012-10-04 Vincent Torri
|
||||||
|
|
||||||
|
* Update lz4 code to rev. 77. This fix compilation on NetBSD 5.0
|
||||||
|
|
||||||
|
2012-10-31 Cedric Bail
|
||||||
|
|
||||||
|
* Add eet_list_entries().
|
||||||
|
* Add eet -l -v to give more information about an eet file.
|
||||||
|
|
||||||
2012-09-27 Patryk Kaczmarek <patryk.k@samsung.com>
|
2012-09-27 Patryk Kaczmarek <patryk.k@samsung.com>
|
||||||
|
|
||||||
* Add eet file handle null checks to eet_data_write_cipher(),
|
* Add eet file handle null checks to eet_data_write_cipher(),
|
||||||
|
@ -35,37 +74,3 @@
|
||||||
|
|
||||||
* Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
|
* Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
|
||||||
first item in the struct.
|
first item in the struct.
|
||||||
|
|
||||||
2012-10-04 Vincent Torri
|
|
||||||
|
|
||||||
* Update lz4 code to rev. 77. This fix compilation on NetBSD 5.0
|
|
||||||
|
|
||||||
2012-10-17 Carsten Haitzler (The Rasterman)
|
|
||||||
|
|
||||||
* Add eina_barrier API to cover pthread_barrier functionality
|
|
||||||
* Add eina_tmpstr_add() and eina_tmpstr_del().
|
|
||||||
|
|
||||||
2012-10-19 Patryk Kaczmarek
|
|
||||||
|
|
||||||
* eina_stringshare_add_length return NULL when func args are wrong.
|
|
||||||
|
|
||||||
2012-10-19 Cedric Bail
|
|
||||||
|
|
||||||
* Add eina_thread API.
|
|
||||||
|
|
||||||
2012-10-31 Cedric Bail
|
|
||||||
|
|
||||||
* Add eet_list_entries().
|
|
||||||
* Add eet -l -v to give more information about an eet file.
|
|
||||||
|
|
||||||
2012-11-09 Vincent Torri
|
|
||||||
|
|
||||||
* Fixed longstanding memset bug in evas box.
|
|
||||||
|
|
||||||
2012-11-10 Vincent Torri
|
|
||||||
|
|
||||||
* Fix build of eina_file on Solaris 10
|
|
||||||
|
|
||||||
2012-11-12 Mike Blumenkrantz
|
|
||||||
|
|
||||||
* Add eina_list_last_data_get
|
|
||||||
|
|
2
NEWS
2
NEWS
|
@ -22,3 +22,5 @@ Fixes:
|
||||||
* Fix PPC (big endian) image codec bug.
|
* Fix PPC (big endian) image codec bug.
|
||||||
* Fix return value of eina_mmap_safety_enabled_set() and future
|
* Fix return value of eina_mmap_safety_enabled_set() and future
|
||||||
eina_mmap_safety_enabled_get() returns after success
|
eina_mmap_safety_enabled_get() returns after success
|
||||||
|
* Fixed GLX native surface handling to use glXChooseFBConfig.
|
||||||
|
This frixes a break in compositing on new intel mesa drivers.
|
||||||
|
|
|
@ -342,9 +342,8 @@ evgl_eng_window_surface_destroy(void *data, void *surface)
|
||||||
eglDestroySurface(re->win->egl_disp, (EGLSurface)surface);
|
eglDestroySurface(re->win->egl_disp, (EGLSurface)surface);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
surface = NULL;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
if (surface) return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -1888,16 +1887,88 @@ eng_image_native_set(void *data, void *image, void *native)
|
||||||
n = calloc(1, sizeof(Native));
|
n = calloc(1, sizeof(Native));
|
||||||
if (n)
|
if (n)
|
||||||
{
|
{
|
||||||
int pixmap_att[20];
|
int pixmap_att[20], i;
|
||||||
unsigned int target = 0;
|
int config_attrs[40], num = 0;
|
||||||
unsigned int i = 0;
|
int tex_format = 0, tex_target = 0, yinvert = 0, mipmap = 0;
|
||||||
|
unsigned int target;
|
||||||
|
GLXFBConfig *configs;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
config_attrs[i++] = GLX_BUFFER_SIZE;
|
||||||
|
config_attrs[i++] = depth;
|
||||||
|
if (depth == 32)
|
||||||
|
{
|
||||||
|
config_attrs[i++] = GLX_BIND_TO_TEXTURE_RGBA_EXT;
|
||||||
|
config_attrs[i++] = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
config_attrs[i++] = GLX_BIND_TO_TEXTURE_RGB_EXT;
|
||||||
|
config_attrs[i++] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef GLX_VISUAL_ID
|
||||||
|
# define GLX_VISUAL_ID 0x800b
|
||||||
|
#endif
|
||||||
|
config_attrs[i++] = GLX_VISUAL_ID;
|
||||||
|
config_attrs[i++] = XVisualIDFromVisual(vis);
|
||||||
|
#ifndef GLX_SAMPLE_BUFFERS
|
||||||
|
# define GLX_SAMPLE_BUFFERS 0x186a0
|
||||||
|
#endif
|
||||||
|
config_attrs[i++] = GLX_SAMPLE_BUFFERS;
|
||||||
|
config_attrs[i++] = 0;
|
||||||
|
config_attrs[i++] = GLX_DEPTH_SIZE;
|
||||||
|
config_attrs[i++] = 0;
|
||||||
|
config_attrs[i++] = GLX_STENCIL_SIZE;
|
||||||
|
config_attrs[i++] = 0;
|
||||||
|
config_attrs[i++] = GLX_AUX_BUFFERS;
|
||||||
|
config_attrs[i++] = 0;
|
||||||
|
config_attrs[i++] = GLX_STEREO;
|
||||||
|
config_attrs[i++] = 0;
|
||||||
|
|
||||||
|
config_attrs[i++] = 0;
|
||||||
|
|
||||||
|
configs = glXChooseFBConfig(re->win->disp,
|
||||||
|
re->win->screen,
|
||||||
|
config_attrs,
|
||||||
|
&num);
|
||||||
|
if (configs)
|
||||||
|
{
|
||||||
|
int j = 0, val = 0;
|
||||||
|
|
||||||
|
tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
|
||||||
|
glXGetFBConfigAttrib(re->win->disp, configs[j],
|
||||||
|
GLX_ALPHA_SIZE, &val);
|
||||||
|
if (val > 0)
|
||||||
|
{
|
||||||
|
glXGetFBConfigAttrib(re->win->disp, configs[j],
|
||||||
|
GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
|
||||||
|
if (val) tex_format = GLX_TEXTURE_FORMAT_RGBA_EXT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glXGetFBConfigAttrib(re->win->disp, configs[j],
|
||||||
|
GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
|
||||||
|
if (val) tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
|
||||||
|
}
|
||||||
|
glXGetFBConfigAttrib(re->win->disp, configs[j],
|
||||||
|
GLX_Y_INVERTED_EXT, &val);
|
||||||
|
yinvert = val;
|
||||||
|
glXGetFBConfigAttrib(re->win->disp, configs[j],
|
||||||
|
GLX_BIND_TO_TEXTURE_TARGETS_EXT,
|
||||||
|
&val);
|
||||||
|
tex_target = val;
|
||||||
|
glXGetFBConfigAttrib(re->win->disp, configs[j],
|
||||||
|
GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
|
||||||
|
mipmap = val;
|
||||||
|
n->fbc = configs[j];
|
||||||
|
XFree(configs);
|
||||||
|
}
|
||||||
|
|
||||||
eina_hash_add(re->win->gl_context->shared->native_pm_hash, &pmid, im);
|
eina_hash_add(re->win->gl_context->shared->native_pm_hash, &pmid, im);
|
||||||
if ((re->win->depth_cfg[depth].tex_target &
|
if ((tex_target & GLX_TEXTURE_2D_BIT_EXT))
|
||||||
GLX_TEXTURE_2D_BIT_EXT))
|
|
||||||
target = GLX_TEXTURE_2D_EXT;
|
target = GLX_TEXTURE_2D_EXT;
|
||||||
else if ((re->win->depth_cfg[depth].tex_target &
|
else if ((target & GLX_TEXTURE_RECTANGLE_BIT_EXT))
|
||||||
GLX_TEXTURE_RECTANGLE_BIT_EXT))
|
|
||||||
{
|
{
|
||||||
ERR("rect!!! (not handled)");
|
ERR("rect!!! (not handled)");
|
||||||
target = GLX_TEXTURE_RECTANGLE_EXT;
|
target = GLX_TEXTURE_RECTANGLE_EXT;
|
||||||
|
@ -1905,31 +1976,27 @@ eng_image_native_set(void *data, void *image, void *native)
|
||||||
if (!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
ERR("broken tex-from-pixmap");
|
ERR("broken tex-from-pixmap");
|
||||||
if (!(re->win->depth_cfg[depth].tex_target &
|
if (!(tex_target & GLX_TEXTURE_2D_BIT_EXT))
|
||||||
GLX_TEXTURE_2D_BIT_EXT))
|
|
||||||
target = GLX_TEXTURE_RECTANGLE_EXT;
|
target = GLX_TEXTURE_RECTANGLE_EXT;
|
||||||
else if (!(re->win->depth_cfg[depth].tex_target &
|
else if (!(tex_target & GLX_TEXTURE_RECTANGLE_BIT_EXT))
|
||||||
GLX_TEXTURE_RECTANGLE_BIT_EXT))
|
|
||||||
target = GLX_TEXTURE_2D_EXT;
|
target = GLX_TEXTURE_2D_EXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
pixmap_att[i++] = GLX_TEXTURE_FORMAT_EXT;
|
pixmap_att[i++] = GLX_TEXTURE_FORMAT_EXT;
|
||||||
pixmap_att[i++] = re->win->depth_cfg[depth].tex_format;
|
pixmap_att[i++] = tex_format;
|
||||||
pixmap_att[i++] = GLX_MIPMAP_TEXTURE_EXT;
|
pixmap_att[i++] = GLX_MIPMAP_TEXTURE_EXT;
|
||||||
pixmap_att[i++] = re->win->depth_cfg[depth].mipmap;
|
pixmap_att[i++] = mipmap;
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
pixmap_att[i++] = GLX_TEXTURE_TARGET_EXT;
|
pixmap_att[i++] = GLX_TEXTURE_TARGET_EXT;
|
||||||
pixmap_att[i++] = target;
|
pixmap_att[i++] = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
pixmap_att[i++] = 0;
|
pixmap_att[i++] = 0;
|
||||||
|
|
||||||
memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
|
memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
|
||||||
n->pixmap = pm;
|
n->pixmap = pm;
|
||||||
n->visual = vis;
|
n->visual = vis;
|
||||||
n->fbc = re->win->depth_cfg[depth].fbc;
|
|
||||||
if (glsym_glXCreatePixmap)
|
if (glsym_glXCreatePixmap)
|
||||||
n->glx_pixmap = glsym_glXCreatePixmap(re->win->disp,
|
n->glx_pixmap = glsym_glXCreatePixmap(re->win->disp,
|
||||||
n->fbc,
|
n->fbc,
|
||||||
|
@ -1953,7 +2020,7 @@ eng_image_native_set(void *data, void *image, void *native)
|
||||||
if (target == GLX_TEXTURE_2D_EXT)
|
if (target == GLX_TEXTURE_2D_EXT)
|
||||||
{
|
{
|
||||||
im->native.target = GL_TEXTURE_2D;
|
im->native.target = GL_TEXTURE_2D;
|
||||||
im->native.mipmap = re->win->depth_cfg[depth].mipmap;
|
im->native.mipmap = mipmap;
|
||||||
}
|
}
|
||||||
# ifdef GL_TEXTURE_RECTANGLE_ARB
|
# ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||||
else if (target == GLX_TEXTURE_RECTANGLE_EXT)
|
else if (target == GLX_TEXTURE_RECTANGLE_EXT)
|
||||||
|
@ -1971,7 +2038,7 @@ eng_image_native_set(void *data, void *image, void *native)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ERR("GLX Pixmap create fail");
|
ERR("GLX Pixmap create fail");
|
||||||
im->native.yinvert = re->win->depth_cfg[depth].yinvert;
|
im->native.yinvert = yinvert;
|
||||||
im->native.loose = re->win->detected.loose_binding;
|
im->native.loose = re->win->detected.loose_binding;
|
||||||
im->native.data = n;
|
im->native.data = n;
|
||||||
im->native.func.data = re;
|
im->native.func.data = re;
|
||||||
|
|
|
@ -83,13 +83,6 @@ struct _Evas_GL_X11_Window
|
||||||
#else
|
#else
|
||||||
GLXContext context;
|
GLXContext context;
|
||||||
GLXWindow glxwin;
|
GLXWindow glxwin;
|
||||||
struct {
|
|
||||||
GLXFBConfig fbc;
|
|
||||||
int tex_format;
|
|
||||||
int tex_target;
|
|
||||||
int mipmap;
|
|
||||||
unsigned char yinvert : 1;
|
|
||||||
} depth_cfg[33]; // config for all 32 possible depths!
|
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
unsigned int loose_binding : 1;
|
unsigned int loose_binding : 1;
|
||||||
|
|
|
@ -264,9 +264,6 @@ eng_window_new(Display *disp,
|
||||||
}
|
}
|
||||||
if (gw->context)
|
if (gw->context)
|
||||||
{
|
{
|
||||||
int i, j, num;
|
|
||||||
GLXFBConfig *fbc;
|
|
||||||
|
|
||||||
if (gw->glxwin)
|
if (gw->glxwin)
|
||||||
{
|
{
|
||||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||||
|
@ -398,88 +395,6 @@ eng_window_new(Display *disp,
|
||||||
{
|
{
|
||||||
// noothing yet. add more cases and options over time
|
// noothing yet. add more cases and options over time
|
||||||
}
|
}
|
||||||
|
|
||||||
fbc = glXGetFBConfigs(gw->disp, screen, &num);
|
|
||||||
if (!fbc)
|
|
||||||
{
|
|
||||||
ERR("glXGetFBConfigs() returned no fb configs");
|
|
||||||
eng_window_free(gw);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
for (i = 0; i <= 32; i++)
|
|
||||||
{
|
|
||||||
for (j = 0; j < num; j++)
|
|
||||||
{
|
|
||||||
XVisualInfo *vi;
|
|
||||||
int vd;
|
|
||||||
int alph, val, dbuf, stencil, tdepth;
|
|
||||||
int rgba;
|
|
||||||
|
|
||||||
vi = glXGetVisualFromFBConfig(gw->disp, fbc[j]);
|
|
||||||
if (!vi) continue;
|
|
||||||
vd = vi->depth;
|
|
||||||
XFree(vi);
|
|
||||||
|
|
||||||
if (vd != i) continue;
|
|
||||||
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_ALPHA_SIZE, &alph);
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BUFFER_SIZE, &val);
|
|
||||||
|
|
||||||
if ((val != i) && ((val - alph) != i)) continue;
|
|
||||||
|
|
||||||
val = 0;
|
|
||||||
rgba = 0;
|
|
||||||
|
|
||||||
if (i == 32)
|
|
||||||
{
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
|
|
||||||
if (val)
|
|
||||||
{
|
|
||||||
rgba = 1;
|
|
||||||
gw->depth_cfg[i].tex_format = GLX_TEXTURE_FORMAT_RGBA_EXT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!val)
|
|
||||||
{
|
|
||||||
if (rgba) continue;
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
|
|
||||||
if (!val) continue;
|
|
||||||
gw->depth_cfg[i].tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
|
|
||||||
}
|
|
||||||
|
|
||||||
dbuf = 0x7fff;
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DOUBLEBUFFER, &val);
|
|
||||||
if (val > dbuf) continue;
|
|
||||||
dbuf = val;
|
|
||||||
|
|
||||||
stencil = 0x7fff;
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_STENCIL_SIZE, &val);
|
|
||||||
if (val > stencil) continue;
|
|
||||||
stencil = val;
|
|
||||||
|
|
||||||
tdepth = 0x7fff;
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DEPTH_SIZE, &val);
|
|
||||||
if (val > tdepth) continue;
|
|
||||||
tdepth = val;
|
|
||||||
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
|
|
||||||
if (val < 0) continue;
|
|
||||||
gw->depth_cfg[i].mipmap = val;
|
|
||||||
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_Y_INVERTED_EXT, &val);
|
|
||||||
gw->depth_cfg[i].yinvert = val;
|
|
||||||
|
|
||||||
glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &val);
|
|
||||||
gw->depth_cfg[i].tex_target = val;
|
|
||||||
|
|
||||||
gw->depth_cfg[i].fbc = fbc[j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XFree(fbc);
|
|
||||||
if (!gw->depth_cfg[DefaultDepth(gw->disp, screen)].fbc)
|
|
||||||
{
|
|
||||||
WRN("texture from pixmap not going to work");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue