// Create and allocate 2D texture
static void
-_texture_allocate_2d(GLuint tex, GLint ifmt, GLenum fmt, GLenum type, int w, int h)
+_texture_allocate_2d(GLuint tex, GLint ifmt, GLenum fmt, GLenum type, int w, int h, int version)
{
//if (!(*tex))
// glGenTextures(1, tex);
glTexParameteri_evgl_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri_evgl_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri_evgl_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ if (version == EVAS_GL_GLES_1_X)
+ glTexImage2DEVAS_evgl_thread_cmd(1, GL_TEXTURE_2D, 0, ifmt, w, h, 0, fmt, type, NULL);
+ else
glTexImage2D_evgl_thread_cmd(GL_TEXTURE_2D, 0, ifmt, w, h, 0, fmt, type, NULL);
glBindTexture_evgl_thread_cmd(GL_TEXTURE_2D, (GLuint)curr_tex);
}
if ((color_ifmt) && (color_fmt))
{
_texture_create(&color_buf);
- _texture_allocate_2d(color_buf, color_ifmt, color_fmt, GL_UNSIGNED_BYTE, w, h);
+ _texture_allocate_2d(color_buf, color_ifmt, color_fmt, GL_UNSIGNED_BYTE, w, h, EVAS_GL_GLES_2_X);
_texture_attach_2d(color_buf, GL_COLOR_ATTACHMENT0, 0, mult_samples, EVAS_GL_GLES_2_X);
}
{
_texture_create(&depth_stencil_buf);
_texture_allocate_2d(depth_stencil_buf, depth_fmt,
- depth_fmt, GL_UNSIGNED_INT_24_8_OES, w, h);
+ depth_fmt, GL_UNSIGNED_INT_24_8_OES, w, h, EVAS_GL_GLES_2_X);
_texture_attach_2d(depth_stencil_buf, GL_DEPTH_ATTACHMENT,
GL_STENCIL_ATTACHMENT, mult_samples, EVAS_GL_GLES_2_X);
depth_stencil = 1;
if (sfc->color_fmt)
{
_texture_allocate_2d(sfc->color_buf, sfc->color_ifmt, sfc->color_fmt,
- GL_UNSIGNED_BYTE, w, h);
+ GL_UNSIGNED_BYTE, w, h, version);
if (sfc->egl_image)
{
_egl_image_destroy(sfc->egl_image);
{
_texture_allocate_2d(sfc->depth_stencil_buf, GL_DEPTH24_STENCIL8_OES,
sfc->depth_stencil_fmt, GL_UNSIGNED_INT_24_8_OES,
- w, h);
+ w, h, version);
}
else
{
_texture_allocate_2d(sfc->depth_stencil_buf, sfc->depth_stencil_fmt,
sfc->depth_stencil_fmt, GL_UNSIGNED_INT_24_8_OES,
- w, h);
+ w, h, version);
}
}
else
#include "evas_gl_thread_evgl_api_generated.c"
EAPI void
+glTexImage2DEVAS_evgl_thread_cmd(int finish_mode, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
+{
+ if (!evas_evgl_thread_enabled())
+ {
+ glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+ return;
+ }
+
+ int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+ EVGL_Thread_Command_glTexImage2D thread_data_local;
+ EVGL_Thread_Command_glTexImage2D *thread_data = &thread_data_local;
+
+ /* command_allocated flag init. */
+ thread_data->command_allocated = 0;
+
+ if (!evas_gl_thread_force_finish() && !finish_mode)
+ { /* _flush */
+ EVGL_Thread_Command_glTexImage2D *thread_data_new;
+ thread_data_new = eina_mempool_malloc(_mp_command,
+ sizeof(EVGL_Thread_Command_glTexImage2D));
+ if (thread_data_new)
+ {
+ thread_data = thread_data_new;
+ thread_data->command_allocated = 1;
+ thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+ }
+ }
+
+ thread_data->target = target;
+ thread_data->level = level;
+ thread_data->internalformat = internalformat;
+ thread_data->width = width;
+ thread_data->height = height;
+ thread_data->border = border;
+ thread_data->format = format;
+ thread_data->type = type;
+ thread_data->pixels = pixels;
+
+ GLTEXIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+ if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+ goto finish;
+
+ GLTEXIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+ evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+ _evgl_thread_glTexImage2D,
+ thread_data,
+ thread_mode);
+}
+
+EAPI void
glTexSubImage2DEVAS_thread_cmd(int thread_push, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
{
if (!evas_gl_thread_enabled())
#include "evas_gl_thread_gl_link_generated.c"
#include "evas_gl_thread_evgl_link_generated.c"
+void (*glTexImage2DEVAS_evgl_thread_cmd)(int finish_mode, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) = NULL;
void (*glTexSubImage2DEVAS_thread_cmd)(int thread_push, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) = NULL;
void