forked from enlightenment/efl
Fix opengl-es 2.0 engine support to only use GL_UNPACK_ROW_LENGTH
if the correct gles extension exists.
This commit is contained in:
parent
5a00aa5b25
commit
3728c60311
|
@ -1,3 +1,8 @@
|
||||||
|
2013-03-15 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* Fix opengl-es 2.0 engine support to only use GL_UNPACK_ROW_LENGTH
|
||||||
|
if the correct gles extension exists.
|
||||||
|
|
||||||
2013-03-14 Mike Blumenkrantz
|
2013-03-14 Mike Blumenkrantz
|
||||||
|
|
||||||
* fix use of ecore_con_*_flush functions with unconnected objects
|
* fix use of ecore_con_*_flush functions with unconnected objects
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -201,3 +201,4 @@ Fixes:
|
||||||
* fix bug not check data value when get deiconify message
|
* fix bug not check data value when get deiconify message
|
||||||
* fix use of ecore_con_*_flush functions with unconnected objects
|
* fix use of ecore_con_*_flush functions with unconnected objects
|
||||||
* fix setting of write flags on ecore-con servers during connect
|
* fix setting of write flags on ecore-con servers during connect
|
||||||
|
* fix gles support to only use GL_UNPACK_ROW_LENGTH if extension exists
|
||||||
|
|
|
@ -42,6 +42,9 @@
|
||||||
#ifndef GL_BGRA
|
#ifndef GL_BGRA
|
||||||
# define GL_BGRA 0x80E1
|
# define GL_BGRA 0x80E1
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef GL_UNPACK_ROW_LENGTH_EXT
|
||||||
|
# define GL_UNPACK_ROW_LENGTH_EXT 0x0cf2
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef EGL_NO_CONTEXT
|
#ifndef EGL_NO_CONTEXT
|
||||||
# define EGL_NO_CONTEXT 0
|
# define EGL_NO_CONTEXT 0
|
||||||
|
@ -222,6 +225,7 @@ struct _Evas_GL_Shared
|
||||||
Eina_Bool tex_rect : 1;
|
Eina_Bool tex_rect : 1;
|
||||||
Eina_Bool sec_image_map : 1;
|
Eina_Bool sec_image_map : 1;
|
||||||
Eina_Bool bin_program : 1;
|
Eina_Bool bin_program : 1;
|
||||||
|
Eina_Bool unpack_row_length : 1;
|
||||||
// tuning params - per gpu/cpu combo?
|
// tuning params - per gpu/cpu combo?
|
||||||
#define MAX_CUTOUT 512
|
#define MAX_CUTOUT 512
|
||||||
#define DEF_CUTOUT 512
|
#define DEF_CUTOUT 512
|
||||||
|
|
|
@ -578,6 +578,14 @@ evas_gl_common_context_new(void)
|
||||||
shared->info.bin_program = 1;
|
shared->info.bin_program = 1;
|
||||||
else
|
else
|
||||||
glsym_glGetProgramBinary = NULL;
|
glsym_glGetProgramBinary = NULL;
|
||||||
|
#ifdef GL_UNPACK_ROW_LENGTH
|
||||||
|
shared->info.unpack_row_length = 1;
|
||||||
|
# ifdef GL_GLES
|
||||||
|
if (!strstr((char *)ext, "_unpack_subimage"))
|
||||||
|
shared->info.unpack_row_length = 0;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||||
if ((strstr((char *)ext, "GL_EXT_texture_filter_anisotropic")))
|
if ((strstr((char *)ext, "GL_EXT_texture_filter_anisotropic")))
|
||||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
|
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
|
||||||
|
|
|
@ -860,10 +860,11 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
||||||
fmt = tex->pt->format;
|
fmt = tex->pt->format;
|
||||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH
|
if (tex->gc->shared->info.unpack_row_length)
|
||||||
|
{
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
#endif
|
}
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
|
|
||||||
|
@ -896,7 +897,8 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
||||||
1, 1,
|
1, 1,
|
||||||
fmt, tex->pt->dataformat,
|
fmt, tex->pt->dataformat,
|
||||||
im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w) + (im->cache_entry.w - 1));
|
im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w) + (im->cache_entry.w - 1));
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH
|
if (tex->gc->shared->info.unpack_row_length)
|
||||||
|
{
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
|
glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
// |xxx
|
// |xxx
|
||||||
|
@ -913,7 +915,8 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
||||||
1, im->cache_entry.h,
|
1, im->cache_entry.h,
|
||||||
fmt, tex->pt->dataformat,
|
fmt, tex->pt->dataformat,
|
||||||
im->image.data + (im->cache_entry.w - 1));
|
im->image.data + (im->cache_entry.w - 1));
|
||||||
#else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
DATA32 *tpix, *ps, *pd;
|
DATA32 *tpix, *ps, *pd;
|
||||||
int i;
|
int i;
|
||||||
|
@ -950,7 +953,6 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
||||||
fmt, tex->pt->dataformat,
|
fmt, tex->pt->dataformat,
|
||||||
tpix);
|
tpix);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||||
|
@ -1045,10 +1047,11 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
|
||||||
if (!tex->pt) return;
|
if (!tex->pt) return;
|
||||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH
|
if (tex->gc->shared->info.unpack_row_length)
|
||||||
|
{
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
#endif
|
}
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
_tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
|
_tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
|
||||||
|
@ -1121,7 +1124,8 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
||||||
{
|
{
|
||||||
if (!tex->pt) return;
|
if (!tex->pt) return;
|
||||||
// FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
|
// FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH
|
if (tex->gc->shared->info.unpack_row_length)
|
||||||
|
{
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
|
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
@ -1142,7 +1146,9 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
_tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
|
_tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
|
||||||
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
|
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
|
||||||
#else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
unsigned int y;
|
unsigned int y;
|
||||||
|
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
@ -1179,7 +1185,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
||||||
for (y = 0; y < (h / 2); y++)
|
for (y = 0; y < (h / 2); y++)
|
||||||
_tex_sub_2d(0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
|
_tex_sub_2d(0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||||
|
@ -1376,7 +1382,8 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
||||||
tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
|
tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
|
||||||
|
|
||||||
// FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
|
// FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH
|
if (tex->gc->shared->info.unpack_row_length)
|
||||||
|
{
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
|
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
@ -1391,7 +1398,9 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
||||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||||
_tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
|
_tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
|
||||||
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
|
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
|
||||||
#else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
unsigned int y;
|
unsigned int y;
|
||||||
|
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
@ -1417,7 +1426,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
||||||
for (y = 0; y < (h / 2); y++)
|
for (y = 0; y < (h / 2); y++)
|
||||||
_tex_sub_2d(0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
|
_tex_sub_2d(0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||||
|
|
Loading…
Reference in New Issue