Evas GL common: Improve code readability (simplify macro)
The exact same ugly macro would appear hundreds of times in the GL code: GLERR(__FUNCTION__, __FILE__, __LINE__, ""); Instead, override the common GL functions iif GL_ERRORS is defined. This greatly simplifies code and removes tons of useless lines. Also, this will give better debugging output as the exact code line is printed, and the function name is also printed. Also, fix linking to the glerr function. This is a code cleanup. Hopefully I didn't break anything with this big operation of find & replace.
This commit is contained in:
parent
9eaadb2eb7
commit
651f0ae241
|
@ -1169,13 +1169,8 @@ _shader_compile(GLuint shader, const char *src)
|
|||
GLint ok;
|
||||
|
||||
glShaderSource(shader, 1, &src, NULL);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glCompileShader(shader);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &ok);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
|
@ -1223,18 +1218,13 @@ _program_build(E3D_Program *program, const char *vert_src, const char *frag_src)
|
|||
|
||||
/* Attach shaders. */
|
||||
glAttachShader(program->prog, program->vert);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glAttachShader(program->prog, program->frag);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
/* Link program. */
|
||||
glLinkProgram(program->prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
/* Check link status. */
|
||||
glGetProgramiv(program->prog, GL_LINK_STATUS, &ok);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -682,7 +682,7 @@ typedef void (*Evas_GL_Common_Context_Resize_Call)(Evas_Engine_GL_Context *gc, i
|
|||
typedef int (*Evas_GL_Common_Buffer_Dump_Call)(Evas_Engine_GL_Context *gc,const char* dname, const char* fname, int frame, const char* suffix);
|
||||
typedef void (*Evas_Gl_Symbols)(void *(*GetProcAddress)(const char *sym));
|
||||
|
||||
void glerr(int err, const char *file, const char *func, int line, const char *op);
|
||||
EAPI void __evas_gl_err(int err, const char *file, const char *func, int line, const char *op);
|
||||
|
||||
void evas_gl_common_tiling_start(Evas_Engine_GL_Context *gc,
|
||||
int rot, int gw, int gh,
|
||||
|
@ -842,15 +842,76 @@ void pt_unref(Evas_GL_Texture_Pool *pt);
|
|||
//#define GL_ERRORS 1
|
||||
|
||||
#ifdef GL_ERRORS
|
||||
# define GLERR(fn, fl, ln, op) \
|
||||
{ \
|
||||
#include <dlfcn.h>
|
||||
static inline void
|
||||
__evas_gl_errdyn(int err, const char *file, const char *func, int line, const char *op)
|
||||
{
|
||||
static void (*sym)(int,const char*,const char*,int,const char*) = NULL;
|
||||
if (!sym) sym = dlsym(RTLD_DEFAULT, "__evas_gl_err");
|
||||
sym(err, file, func, line, op);
|
||||
}
|
||||
# define GLERRV(op) \
|
||||
{ \
|
||||
int __gl_err = glGetError(); \
|
||||
if (__gl_err != GL_NO_ERROR) glerr(__gl_err, fl, fn, ln, op); \
|
||||
if (__gl_err != GL_NO_ERROR) \
|
||||
__evas_gl_errdyn(__gl_err, __FILE__, __FUNCTION__, __LINE__, op); \
|
||||
}
|
||||
/* Redefine common gl funcs */
|
||||
# ifndef GL_ERRORS_NODEF
|
||||
# define glActiveTexture(...) do { glActiveTexture(__VA_ARGS__); GLERRV("glActiveTexture"); } while(0)
|
||||
# define glBindAttribLocation(...) do { glBindAttribLocation(__VA_ARGS__); GLERRV("glBindAttribLocation"); } while(0)
|
||||
# define glBindBuffer(...) do { glBindBuffer(__VA_ARGS__); GLERRV("glBindBuffer"); } while(0)
|
||||
# define glBindTexture(...) do { glBindTexture(__VA_ARGS__); GLERRV("glBindTexture"); } while(0)
|
||||
# define glBlendFunc(...) do { glBlendFunc(__VA_ARGS__); GLERRV("glBlendFunc"); } while(0)
|
||||
# define glBufferData(...) do { glBufferData(__VA_ARGS__); GLERRV("glBufferData"); } while(0)
|
||||
# define glCompressedTexSubImage2D(...) do { glCompressedTexSubImage2D(__VA_ARGS__); GLERRV("glCompressedTexSubImage2D"); } while(0)
|
||||
# define glDeleteBuffers(...) do { glDeleteBuffers(__VA_ARGS__); GLERRV("glDeleteBuffers"); } while(0)
|
||||
# define glDepthMask(...) do { glDepthMask(__VA_ARGS__); GLERRV("glDepthMask"); } while(0)
|
||||
# define glDisable(...) do { glDisable(__VA_ARGS__); GLERRV("glDisable"); } while(0)
|
||||
# define glDisableVertexAttribArray(...) do { glDisableVertexAttribArray(__VA_ARGS__); GLERRV("glDisableVertexAttribArray"); } while(0)
|
||||
# define glDrawArrays(...) do { glDrawArrays(__VA_ARGS__); GLERRV("glDrawArrays"); } while(0)
|
||||
# define glEnable(...) do { glEnable(__VA_ARGS__); GLERRV("glEnable"); } while(0)
|
||||
# define glEnableVertexAttribArray(...) do { glEnableVertexAttribArray(__VA_ARGS__); GLERRV("glEnableVertexAttribArray"); } while(0)
|
||||
# define glGenBuffers(...) do { glGenBuffers(__VA_ARGS__); GLERRV("glGenBuffers"); } while(0)
|
||||
# define glGetFloatv(...) do { glGetFloatv(__VA_ARGS__); GLERRV("glGetFloatv"); } while(0)
|
||||
# define glGetIntegerv(...) do { glGetIntegerv(__VA_ARGS__); GLERRV("glGetIntegerv"); } while(0)
|
||||
# define glGetUniformLocation(...) ({ GLint _x = glGetUniformLocation(__VA_ARGS__); GLERRV("glGetUniformLocation"); _x; })
|
||||
# define glHint(...) do { glHint(__VA_ARGS__); GLERRV("glHint"); } while(0)
|
||||
# define glReadPixels(...) do { glReadPixels(__VA_ARGS__); GLERRV("glReadPixels"); } while(0)
|
||||
# define glScissor(...) do { glScissor(__VA_ARGS__); GLERRV("glScissor"); } while(0)
|
||||
# define glGenFramebuffers(...) do { glGenFramebuffers(__VA_ARGS__); GLERRV("glGenFramebuffers"); } while(0)
|
||||
# define glBindFramebuffer(...) do { glBindFramebuffer(__VA_ARGS__); GLERRV("glBindFramebuffer"); } while(0)
|
||||
# define glEndTiling(...) do { glEndTiling(__VA_ARGS__); GLERRV("glEndTiling"); } while(0)
|
||||
# define glGetProgramBinary(...) do { glGetProgramBinary(__VA_ARGS__); GLERRV("glGetProgramBinary"); } while(0)
|
||||
# define glMapBuffer(...) ({ void *_x = glMapBuffer(__VA_ARGS__); GLERRV("glMapBuffer"); _x; })
|
||||
# define glStartTiling(...) do { glStartTiling(__VA_ARGS__); GLERRV("glStartTiling"); } while(0)
|
||||
# define glUnmapBuffer(...) do { glUnmapBuffer(__VA_ARGS__); GLERRV("glUnmapBuffer"); } while(0)
|
||||
# define glTexParameterf(...) do { glTexParameterf(__VA_ARGS__); GLERRV("glTexParameterf"); } while(0)
|
||||
# define glTexParameteri(...) do { glTexParameteri(__VA_ARGS__); GLERRV("glTexParameteri"); } while(0)
|
||||
# define glTexSubImage2D(...) do { glTexSubImage2D(__VA_ARGS__); GLERRV("glTexSubImage2D"); } while(0)
|
||||
# define glUniform1f(...) do { glUniform1f(__VA_ARGS__); GLERRV("glUniform1f"); } while(0)
|
||||
# define glUniform1i(...) do { glUniform1i(__VA_ARGS__); GLERRV("glUniform1i"); } while(0)
|
||||
# define glUniform2fv(...) do { glUniform2fv(__VA_ARGS__); GLERRV("glUniform2fv"); } while(0)
|
||||
# define glUniform4fv(...) do { glUniform4fv(__VA_ARGS__); GLERRV("glUniform4fv"); } while(0)
|
||||
# define glUniformMatrix4fv(...) do { glUniformMatrix4fv(__VA_ARGS__); GLERRV("glUniformMatrix4fv"); } while(0)
|
||||
# define glUseProgram(...) do { glUseProgram(__VA_ARGS__); GLERRV("glUseProgram"); } while(0)
|
||||
# define glVertexAttribPointer(...) do { glVertexAttribPointer(__VA_ARGS__); GLERRV("glVertexAttribPointer"); } while(0)
|
||||
# define glViewport(...) do { glViewport(__VA_ARGS__); GLERRV("glViewport"); } while(0)
|
||||
# define glPixelStorei(...) do { glPixelStorei(__VA_ARGS__); GLERRV("glPixelStorei"); } while(0)
|
||||
# define glCompressedTexImage2D(...) do { glCompressedTexImage2D(__VA_ARGS__); GLERRV("glCompressedTexImage2D"); } while(0)
|
||||
# define glCreateShader(...) ({ GLuint _x = glCreateShader(__VA_ARGS__); GLERRV("glCreateShader"); _x; })
|
||||
# define glCreateProgram(...) ({ GLuint _x = glCreateProgram(__VA_ARGS__); GLERRV("glCreateProgram"); _x; })
|
||||
# define glAttachShader(...) do { glAttachShader(__VA_ARGS__); GLERRV("glAttachShader"); } while(0)
|
||||
# define glLinkProgram(...) do { glLinkProgram(__VA_ARGS__); GLERRV("glLinkProgram"); } while(0)
|
||||
# define glGetProgramiv(...) do { glGetProgramiv(__VA_ARGS__); GLERRV("glGetProgramiv"); } while(0)
|
||||
# define glGetProgramInfoLog(...) do { glGetProgramInfoLog(__VA_ARGS__); GLERRV("glGetProgramInfoLog"); } while(0)
|
||||
# define glGetShaderiv(...) do { glGetShaderiv(__VA_ARGS__); GLERRV("glGetShaderiv"); } while(0)
|
||||
# define glShaderSource(...) do { glShaderSource(__VA_ARGS__); GLERRV("glShaderSource"); } while(0)
|
||||
# define glCompileShader(...) do { glCompileShader(__VA_ARGS__); GLERRV("glCompileShader"); } while(0)
|
||||
# endif
|
||||
#else
|
||||
# define GLERR(fn, fl, ln, op)
|
||||
# define GLERRV(op)
|
||||
#endif
|
||||
#define GLERRLOG() GLERR(__FUNCTION__, __FILE__, __LINE__, "")
|
||||
|
||||
Eina_Bool evas_gl_common_module_open(void);
|
||||
void evas_gl_common_module_close(void);
|
||||
|
@ -861,7 +922,6 @@ _tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int
|
|||
if ((w > gc->shared->info.max_texture_size) ||
|
||||
(h > gc->shared->info.max_texture_size)) return;
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -870,7 +930,6 @@ _comp_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt
|
|||
if ((w > gc->shared->info.max_texture_size) ||
|
||||
(h > gc->shared->info.max_texture_size)) return;
|
||||
glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, imgsize, pix);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "glCompressedTexSubImage2D");
|
||||
}
|
||||
|
||||
#include "evas_gl_3d_common.h"
|
||||
|
|
|
@ -201,8 +201,8 @@ static void shader_array_flush(Evas_Engine_GL_Context *gc);
|
|||
static Evas_Engine_GL_Context *_evas_gl_common_context = NULL;
|
||||
static Evas_GL_Shared *shared = NULL;
|
||||
|
||||
void
|
||||
glerr(int err, const char *file, const char *func, int line, const char *op)
|
||||
EAPI void
|
||||
__evas_gl_err(int err, const char *file, const char *func, int line, const char *op)
|
||||
{
|
||||
const char *errmsg;
|
||||
char buf[32];
|
||||
|
@ -436,7 +436,6 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
|
|||
glViewport(0, 0, w, h);
|
||||
else
|
||||
glViewport(0, 0, h, w);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
// std matrix
|
||||
if (m == 1)
|
||||
matrix_ortho(proj,
|
||||
|
@ -518,15 +517,12 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
|
|||
for (i = 0; i < SHADER_LAST; ++i)
|
||||
{
|
||||
glUseProgram(gc->shared->shader[i].prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader[i].prog, "mvp"), 1, GL_FALSE, proj);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
if (gc->state.current.cur_prog == PRG_INVALID)
|
||||
glUseProgram(gc->shared->shader[0].prog);
|
||||
else glUseProgram(gc->state.current.cur_prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
EAPI Evas_Engine_GL_Context *
|
||||
|
@ -784,47 +780,31 @@ evas_gl_common_context_new(void)
|
|||
);
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glEnable(GL_DITHER);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDisable(GL_BLEND);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
// no dest alpha
|
||||
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
|
||||
// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
|
||||
glDepthMask(GL_FALSE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
if (shared->info.anisotropic > 0.0)
|
||||
{
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
|
||||
#endif
|
||||
|
||||
glEnableVertexAttribArray(SHAD_VERTEX);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glEnableVertexAttribArray(SHAD_COLOR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
if (!evas_gl_common_shader_program_init(shared)) goto error;
|
||||
|
||||
#define SHADER_TEXTURE_ADD(Shared, Shader, Name) \
|
||||
glUseProgram(Shared->shader[SHADER_##Shader].prog); \
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, ""); \
|
||||
glUniform1i(glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++); \
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glUniform1i(glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++);
|
||||
|
||||
SHADER_TEXTURE_ADD(shared, YUV, tex);
|
||||
SHADER_TEXTURE_ADD(shared, YUV, texu);
|
||||
|
@ -893,7 +873,6 @@ evas_gl_common_context_new(void)
|
|||
if (gc->state.current.cur_prog == PRG_INVALID)
|
||||
glUseProgram(shared->shader[0].prog);
|
||||
else glUseProgram(gc->state.current.cur_prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
evas_gl_common_shader_program_init_done();
|
||||
// in shader:
|
||||
|
@ -1069,53 +1048,34 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
|
|||
gc->change.size = 1;
|
||||
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glScissor(0, 0, 0, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glEnable(GL_DITHER);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDisable(GL_BLEND);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
// no dest alpha
|
||||
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
|
||||
// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
|
||||
glDepthMask(GL_FALSE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
if (shared->info.anisotropic > 0.0)
|
||||
{
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
|
||||
#endif
|
||||
|
||||
glEnableVertexAttribArray(SHAD_VERTEX);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glEnableVertexAttribArray(SHAD_COLOR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (gc->state.current.cur_prog == PRG_INVALID)
|
||||
glUseProgram(gc->shared->shader[0].prog);
|
||||
else glUseProgram(gc->state.current.cur_prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
_evas_gl_common_viewport_set(gc);
|
||||
}
|
||||
|
@ -1157,6 +1117,7 @@ evas_gl_common_tiling_start(Evas_Engine_GL_Context *gc EINA_UNUSED,
|
|||
glsym_glStartTiling(cx, cy, cw, ch, bitmask);
|
||||
break;
|
||||
}
|
||||
GLERRV("glsym_glStartTiling");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1165,6 +1126,7 @@ evas_gl_common_tiling_done(Evas_Engine_GL_Context *gc EINA_UNUSED)
|
|||
if (glsym_glEndTiling)
|
||||
{
|
||||
glsym_glEndTiling(GL_COLOR_BUFFER_BIT0_QCOM);
|
||||
GLERRV("glsym_glEndTiling");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1174,7 +1136,11 @@ evas_gl_common_context_done(Evas_Engine_GL_Context *gc)
|
|||
{
|
||||
if (gc->master_clip.used)
|
||||
{
|
||||
if (glsym_glEndTiling) glsym_glEndTiling(GL_COLOR_BUFFER_BIT0_QCOM);
|
||||
if (glsym_glEndTiling)
|
||||
{
|
||||
glsym_glEndTiling(GL_COLOR_BUFFER_BIT0_QCOM);
|
||||
GLERRV("glsym_glEndTiling");
|
||||
}
|
||||
gc->master_clip.used = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1216,12 +1182,12 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
|
|||
if (gc->pipe[0].shader.surface == gc->def_surface)
|
||||
{
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glBindFramebuffer");
|
||||
}
|
||||
else
|
||||
{
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glBindFramebuffer");
|
||||
}
|
||||
_evas_gl_common_viewport_set(gc);
|
||||
}
|
||||
|
@ -1411,10 +1377,7 @@ shader_array_uniforms_set(Evas_Engine_GL_Context *gc, int n)
|
|||
if (u->location >= 0)
|
||||
loc = u->location;
|
||||
else
|
||||
{
|
||||
loc = glGetUniformLocation(gc->pipe[n].shader.cur_prog, u->name);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "glGetUniformLocation");
|
||||
}
|
||||
loc = glGetUniformLocation(gc->pipe[n].shader.cur_prog, u->name);
|
||||
if (loc >= 0)
|
||||
{
|
||||
switch (u->type)
|
||||
|
@ -1430,7 +1393,6 @@ shader_array_uniforms_set(Evas_Engine_GL_Context *gc, int n)
|
|||
break;
|
||||
default: ERR("Unhandled uniform type"); break;
|
||||
}
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "glUniform");
|
||||
}
|
||||
eina_stringshare_del(u->name);
|
||||
free(u);
|
||||
|
@ -2852,6 +2814,7 @@ start_tiling(Evas_Engine_GL_Context *gc EINA_UNUSED,
|
|||
glsym_glStartTiling(cx, cy, cw, ch, bitmask);
|
||||
break;
|
||||
}
|
||||
GLERRV("glsym_glStartTiling");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2880,11 +2843,10 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
pipe_done++;
|
||||
gc->flushnum++;
|
||||
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "<flush err>");
|
||||
GLERRV("<flush err>");
|
||||
if (gc->pipe[i].shader.cur_prog != gc->state.current.cur_prog)
|
||||
{
|
||||
glUseProgram(gc->pipe[i].shader.cur_prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
if (gc->pipe[i].shader.cur_tex != gc->state.current.cur_tex)
|
||||
|
@ -2893,18 +2855,14 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
if (gc->pipe[i].shader.cur_tex)
|
||||
{
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
#endif
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
if (gc->pipe[i].array.im)
|
||||
{
|
||||
|
@ -2967,20 +2925,13 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
}
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
if (gc->pipe[i].shader.blend != gc->state.current.blend)
|
||||
{
|
||||
if (gc->pipe[i].shader.blend)
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glEnable(GL_BLEND);
|
||||
else
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
if ((gc->pipe[i].shader.smooth != gc->state.current.smooth) ||
|
||||
(gc->pipe[i].shader.cur_tex != gc->state.current.cur_tex))
|
||||
|
@ -2989,37 +2940,23 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
{
|
||||
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
if (shared->info.anisotropic > 0.0)
|
||||
{
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
|
||||
#endif
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
if (shared->info.anisotropic > 0.0)
|
||||
{
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
|
||||
#endif
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
}
|
||||
if (gc->pipe[i].shader.clip != gc->state.current.clip)
|
||||
|
@ -3170,6 +3107,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
gc->pipe[i].array.buffer_use++;
|
||||
|
||||
x = glsym_glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
|
||||
GLERRV("glsym_glMapBuffer");
|
||||
if (x)
|
||||
{
|
||||
if (gc->pipe[i].array.use_vertex)
|
||||
|
@ -3201,6 +3139,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
gc->pipe[i].array.use_texm);
|
||||
*/
|
||||
glsym_glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
GLERRV("glsym_glUnmapBuffer");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3214,9 +3153,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
texm_ptr = (unsigned char *)gc->pipe[i].array.texm;
|
||||
}
|
||||
glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, (void *)vertex_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glVertexAttribPointer(SHAD_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, (void *)color_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
if (gc->pipe[i].array.line)
|
||||
{
|
||||
|
@ -3233,17 +3170,11 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
}
|
||||
|
||||
glDisableVertexAttribArray(SHAD_TEXUV);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDisableVertexAttribArray(SHAD_TEXUV2);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDisableVertexAttribArray(SHAD_TEXUV3);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDisableVertexAttribArray(SHAD_TEXA);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDisableVertexAttribArray(SHAD_TEXM);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3252,57 +3183,40 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
if (gc->pipe[i].array.use_texuv)
|
||||
{
|
||||
glEnableVertexAttribArray(SHAD_TEXUV);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0,
|
||||
(void *)texuv_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
MASK_TEXTURE += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisableVertexAttribArray(SHAD_TEXUV);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
/* Alpha plane */
|
||||
if (gc->pipe[i].array.use_texa && (gc->pipe[i].region.type != RTYPE_MAP))
|
||||
{
|
||||
glEnableVertexAttribArray(SHAD_TEXA);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glVertexAttribPointer(SHAD_TEXA, 2, GL_FLOAT, GL_FALSE, 0, (void *)texa_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texa);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
if (shared->info.anisotropic > 0.0)
|
||||
{
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
|
||||
#endif
|
||||
if (gc->pipe[i].shader.smooth)
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
MASK_TEXTURE += 1;
|
||||
}
|
||||
|
@ -3314,63 +3228,42 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
if ((gc->pipe[i].array.use_texuv2) && (gc->pipe[i].array.use_texuv3))
|
||||
{
|
||||
glEnableVertexAttribArray(SHAD_TEXUV2);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glEnableVertexAttribArray(SHAD_TEXUV3);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, (void *)texuv2_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glVertexAttribPointer(SHAD_TEXUV3, 2, GL_FLOAT, GL_FALSE, 0, (void *)texuv3_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_GLES
|
||||
if (gc->pipe[i].shader.cur_texu_dyn)
|
||||
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
|
||||
#endif
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_GLES
|
||||
if (gc->pipe[i].shader.cur_texv_dyn)
|
||||
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
|
||||
#endif
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
MASK_TEXTURE += 2;
|
||||
}
|
||||
else if (gc->pipe[i].array.use_texuv2)
|
||||
{
|
||||
glEnableVertexAttribArray(SHAD_TEXUV2);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, (void *)texuv2_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_GLES
|
||||
if (gc->pipe[i].shader.cur_texu_dyn)
|
||||
secsym_glEGLImageTargetTexture2DOES
|
||||
|
@ -3379,81 +3272,55 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
if (gc->pipe[i].shader.smooth)
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
MASK_TEXTURE += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisableVertexAttribArray(SHAD_TEXUV2);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDisableVertexAttribArray(SHAD_TEXUV3);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
/* Mask surface */
|
||||
if (gc->pipe[i].array.use_texm)
|
||||
{
|
||||
glEnableVertexAttribArray(SHAD_TEXM);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, (void *)texm_ptr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glActiveTexture(MASK_TEXTURE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
if (shared->info.anisotropic > 0.0)
|
||||
{
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
|
||||
#endif
|
||||
if (gc->pipe[i].shader.smooth)
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisableVertexAttribArray(SHAD_TEXM);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
// Push all uniforms
|
||||
|
@ -3476,7 +3343,6 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
);
|
||||
}
|
||||
glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
if (gc->pipe[i].array.im)
|
||||
{
|
||||
|
|
|
@ -2259,10 +2259,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
|
|||
|
||||
// Bind to the previously bound buffer (may be 0)
|
||||
if (ctx->current_fbo)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, ctx->current_fbo);
|
||||
GLERRLOG();
|
||||
}
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, ctx->current_fbo);
|
||||
|
||||
rsc->direct.rendered = 0;
|
||||
}
|
||||
|
@ -2295,7 +2292,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
|
|||
|
||||
// Bind to the previously bound buffer
|
||||
if (ctx->current_fbo)
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, ctx->current_fbo);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, ctx->current_fbo);
|
||||
}
|
||||
rsc->direct.rendered = 0;
|
||||
}
|
||||
|
|
|
@ -74,6 +74,7 @@ _evas_gl_common_shader_program_binary_init(Evas_GL_Program *p,
|
|||
glAttachShader(p->prog, p->frag);
|
||||
#endif
|
||||
glsym_glProgramBinary(p->prog, formats[0], data, length);
|
||||
GLERRV("glsym_glProgramBinary");
|
||||
|
||||
glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
|
||||
glBindAttribLocation(p->prog, SHAD_COLOR, "color");
|
||||
|
@ -84,7 +85,6 @@ _evas_gl_common_shader_program_binary_init(Evas_GL_Program *p,
|
|||
glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
|
||||
|
||||
glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!ok)
|
||||
{
|
||||
gl_compile_link_error(p->prog, "load a program object");
|
||||
|
@ -121,14 +121,13 @@ _evas_gl_common_shader_program_binary_save(Evas_GL_Program *p,
|
|||
if (!glsym_glGetProgramBinary) return 0;
|
||||
|
||||
glGetProgramiv(p->prog, GL_PROGRAM_BINARY_LENGTH, &length);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (length <= 0) return 0;
|
||||
|
||||
data = malloc(length);
|
||||
if (!data) return 0;
|
||||
|
||||
glsym_glGetProgramBinary(p->prog, length, &size, &format, data);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glGetProgramBinary");
|
||||
|
||||
if (length != size)
|
||||
{
|
||||
|
@ -158,12 +157,9 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
|
||||
glShaderSource(p->vert, 1,
|
||||
(const char **)&(vert->src), NULL);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glCompileShader(p->vert);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
ok = 0;
|
||||
glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!ok)
|
||||
{
|
||||
gl_compile_link_error(p->vert, "compile vertex shader");
|
||||
|
@ -172,12 +168,9 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
}
|
||||
glShaderSource(p->frag, 1,
|
||||
(const char **)&(frag->src), NULL);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glCompileShader(p->frag);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
ok = 0;
|
||||
glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!ok)
|
||||
{
|
||||
gl_compile_link_error(p->frag, "compile fragment shader");
|
||||
|
@ -189,34 +182,26 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
#ifdef GL_GLES
|
||||
#else
|
||||
if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri))
|
||||
glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
|
||||
GL_TRUE);
|
||||
{
|
||||
glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
|
||||
GL_TRUE);
|
||||
GLERRV("glsym_glProgramParameteri");
|
||||
}
|
||||
#endif
|
||||
glAttachShader(p->prog, p->vert);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glAttachShader(p->prog, p->frag);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_COLOR, "color");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_TEXA, "tex_coorda");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glLinkProgram(p->prog);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
ok = 0;
|
||||
glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!ok)
|
||||
{
|
||||
gl_compile_link_error(p->prog, "link fragment and vertex shaders");
|
||||
|
@ -364,7 +349,11 @@ evas_gl_common_shader_program_init_done(void)
|
|||
#ifdef GL_GLES
|
||||
glReleaseShaderCompiler();
|
||||
#else
|
||||
if (glsym_glReleaseShaderCompiler) glsym_glReleaseShaderCompiler();
|
||||
if (glsym_glReleaseShaderCompiler)
|
||||
{
|
||||
glsym_glReleaseShaderCompiler();
|
||||
GLERRV("glsym_glReleaseShaderCompiler");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -303,7 +303,6 @@ _tex_2d(Evas_Engine_GL_Context *gc, int intfmt, int w, int h, int fmt, int type)
|
|||
glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL);
|
||||
else
|
||||
glCompressedTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, sz, NULL);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#ifdef GL_TEXTURE_INTERNAL_FORMAT
|
||||
# ifdef GL_GLES
|
||||
# else
|
||||
|
@ -387,20 +386,13 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, GLenum intformat, GLenum
|
|||
pt->eina_pool = eina_rectangle_pool_new(w, h);
|
||||
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat);
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!ok)
|
||||
{
|
||||
glDeleteTextures(1, &(pt->texture));
|
||||
|
@ -602,30 +594,23 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
#endif
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fnum);
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat);
|
||||
|
||||
glsym_glGenFramebuffers(1, &(pt->fb));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glGenFramebuffers");
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glBindFramebuffer");
|
||||
glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glFramebufferTexture2D");
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glBindFramebuffer");
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
|
@ -677,9 +662,7 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
pt->native = 1;
|
||||
pt->eina_pool = eina_rectangle_pool_new(w, h);
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(im->native.target, pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
#ifdef GL_GLES
|
||||
#else
|
||||
|
@ -691,17 +674,11 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
#endif
|
||||
|
||||
glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(im->native.target, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
texinfo.n.num++;
|
||||
texinfo.n.pix += pt->w * pt->h;
|
||||
|
@ -760,17 +737,11 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
_print_tex_count();
|
||||
|
||||
glGenTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
egldisplay = pt->gc->egldisp;
|
||||
|
||||
|
@ -783,13 +754,11 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
EGL_NO_CONTEXT,
|
||||
EGL_MAP_GL_TEXTURE_2D_SEC,
|
||||
0, attr);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("secsym_eglCreateImage");
|
||||
if (!pt->dyn.img)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDeleteTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (pt->eina_pool)
|
||||
eina_rectangle_pool_free(pt->eina_pool);
|
||||
free(pt);
|
||||
|
@ -820,7 +789,6 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
if (pixtype != EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC) goto error;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#else
|
||||
if (gc + w + h + intformat + format) return pt;
|
||||
#endif
|
||||
|
@ -830,12 +798,10 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
#ifdef GL_GLES
|
||||
error:
|
||||
secsym_eglDestroyImage(egldisplay, pt->dyn.img);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("secsym_eglDestroyImage");
|
||||
pt->dyn.img = NULL;
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glDeleteTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (pt->eina_pool)
|
||||
eina_rectangle_pool_free(pt->eina_pool);
|
||||
free(pt);
|
||||
|
@ -899,13 +865,12 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
|
|||
#endif
|
||||
|
||||
glDeleteTextures(1, &(pt->texture));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (pt->gc->pipe[0].shader.cur_tex == pt->texture)
|
||||
pt->gc->pipe[0].shader.cur_tex = 0;
|
||||
if (pt->fb)
|
||||
{
|
||||
glsym_glDeleteFramebuffers(1, &(pt->fb));
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glDeleteFramebuffers");
|
||||
pt->fb = 0;
|
||||
}
|
||||
EINA_LIST_FREE(pt->allocations, apt)
|
||||
|
@ -1025,14 +990,11 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
|
|||
|
||||
fmt = tex->pt->format;
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
|
||||
// +-+
|
||||
|
@ -1088,7 +1050,6 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
|
|||
if (tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
// |xxx
|
||||
// |xxx
|
||||
//
|
||||
|
@ -1142,10 +1103,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
|
|||
tpix);
|
||||
}
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1208,7 +1166,6 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
|||
EINA_SAFETY_ON_FALSE_RETURN(!(width & 0x3) && !(height & 0x3));
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
if ((tex->gc->shared->info.etc1_subimage ||
|
||||
(im->cache_entry.space != EVAS_COLORSPACE_ETC1))
|
||||
|
@ -1226,7 +1183,8 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
|||
err = glGetError();
|
||||
if (err != GL_NO_ERROR)
|
||||
{
|
||||
glerr(err, __FILE__, __FUNCTION__, __LINE__, "glCompressedTexSubImage2D");
|
||||
__evas_gl_err(err, __FILE__, __FUNCTION__, __LINE__,
|
||||
"glCompressedTexSubImage2D");
|
||||
|
||||
// FIXME: Changing settings on the fly.
|
||||
// The first texture will be black.
|
||||
|
@ -1241,13 +1199,11 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
|||
width, height, 0,
|
||||
((width * height) >> 4) * bsize,
|
||||
im->image.data);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1319,23 +1275,17 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
|
|||
// Bind and upload ! Vooom !
|
||||
fmt = tex->ptt->format;
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
_tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out);
|
||||
|
||||
// Switch back to current texture
|
||||
if (tex->ptt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
|
||||
// Now prepare uploading the main texture before returning;
|
||||
async = malloc(sizeof (Evas_GL_Texture_Async_Preload));
|
||||
|
@ -1453,21 +1403,15 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
|
|||
{
|
||||
if (!tex->pt) return;
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
_tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format,
|
||||
tex->pt->dataformat, pixels);
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
}
|
||||
|
||||
Evas_GL_Texture *
|
||||
|
@ -1560,11 +1504,9 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
|
|||
if (!subimage || tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
if (tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, w); GLERRLOG();
|
||||
}
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); GLERRLOG();
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture); GLERRLOG();
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, w);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
|
||||
goto on_error;
|
||||
if (upload)
|
||||
|
@ -1574,7 +1516,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
|
|||
else
|
||||
_tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, data1);
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pta->texture); GLERRLOG();
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pta->texture);
|
||||
if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format, tex->pta->dataformat))
|
||||
goto on_error;
|
||||
if (upload)
|
||||
|
@ -1589,8 +1531,8 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
|
|||
{
|
||||
int y;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); GLERRLOG();
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture); GLERRLOG();
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format,
|
||||
tex->pt->dataformat))
|
||||
goto on_error;
|
||||
|
@ -1616,7 +1558,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
|
|||
}
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pta->texture); GLERRLOG();
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pta->texture);
|
||||
if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format,
|
||||
tex->pta->dataformat))
|
||||
goto on_error;
|
||||
|
@ -1643,7 +1585,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
|
|||
}
|
||||
}
|
||||
on_error:
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); GLERRLOG();
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
}
|
||||
|
||||
Evas_GL_Texture *
|
||||
|
@ -1701,25 +1643,18 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
|||
if (tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
|
||||
return;
|
||||
_tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat))
|
||||
return;
|
||||
_tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat))
|
||||
return;
|
||||
_tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
|
||||
|
@ -1729,9 +1664,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
|||
unsigned int y;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
|
||||
return;
|
||||
if ((rows[1] - rows[0]) == (int)w)
|
||||
|
@ -1743,7 +1676,6 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
|||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat))
|
||||
return;
|
||||
if ((rows[h + 1] - rows[h]) == (int)(w / 2))
|
||||
|
@ -1755,7 +1687,6 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
|||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat))
|
||||
return;
|
||||
if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2))
|
||||
|
@ -1767,10 +1698,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
|
|||
}
|
||||
}
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
}
|
||||
|
||||
static Evas_GL_Texture *
|
||||
|
@ -1910,9 +1838,7 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
|||
tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
|
||||
return;
|
||||
if ((rows[1] - rows[0]) == (int)w * 4)
|
||||
|
@ -1924,7 +1850,6 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
|||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat))
|
||||
return;
|
||||
#if 0
|
||||
|
@ -1942,10 +1867,7 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
|||
}
|
||||
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1961,18 +1883,13 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
|||
if (tex->gc->shared->info.unpack_row_length)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
|
||||
return;
|
||||
_tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat))
|
||||
return;
|
||||
_tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
|
||||
|
@ -1982,9 +1899,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
|||
unsigned int y;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
|
||||
return;
|
||||
if ((rows[1] - rows[0]) == (int)w)
|
||||
|
@ -1996,7 +1911,6 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
|||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat))
|
||||
return;
|
||||
if ((rows[h + 1] - rows[h]) == (int)(w / 2))
|
||||
|
@ -2008,10 +1922,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
|
|||
}
|
||||
}
|
||||
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2169,10 +2080,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
|
|||
#endif
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
// We are telling the driver to not swizzle back the buffer as we are going to replace all pixel
|
||||
if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
|
||||
|
@ -2220,7 +2128,6 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
|
|||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
if (!_tex_2d(tex->gc, tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat))
|
||||
return;
|
||||
|
|
|
@ -891,7 +891,6 @@ _native_cb_bind(void *data EINA_UNUSED, void *image)
|
|||
else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, n->ns.data.opengl.texture_id);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -907,12 +906,10 @@ _native_cb_unbind(void *data EINA_UNUSED, void *image)
|
|||
if (n->ns.type == EVAS_NATIVE_SURFACE_WL)
|
||||
{
|
||||
//glBindTexture(GL_TEXTURE_2D, 0); //really need?
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -237,10 +237,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
|
|||
Evas_Native_Surface *n = im->native.data;
|
||||
|
||||
if (n->type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, n->data.opengl.texture_id);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, n->data.opengl.texture_id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -250,10 +247,7 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
|
|||
Evas_Native_Surface *n = im->native.data;
|
||||
|
||||
if (n->type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -583,7 +577,7 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
|
|||
if (!im->tex->pt->dyn.data)
|
||||
{
|
||||
if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("secsym_eglMapImageSEC");
|
||||
return im;
|
||||
}
|
||||
im->tex->pt->dyn.checked_out++;
|
||||
|
@ -1343,6 +1337,7 @@ eng_gl_surface_read_pixels(void *data, void *surface,
|
|||
*/
|
||||
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, im->tex->pt->fb);
|
||||
GLERRV("glsym_glBindFramebuffer");
|
||||
if (im->tex->pt->format == GL_BGRA)
|
||||
glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
|
||||
else
|
||||
|
@ -1360,6 +1355,7 @@ eng_gl_surface_read_pixels(void *data, void *surface,
|
|||
}
|
||||
}
|
||||
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
GLERRV("glsym_glBindFramebuffer");
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
|
|
@ -1743,7 +1743,7 @@ eng_preload_make_current(void *data, void *doit)
|
|||
{
|
||||
ERR("glXMakeContextCurrent(%p, %p, %p) failed",
|
||||
ob->info->info.display, (void *)ob->win, (void *)ob->context);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("__glXMakeContextCurrent");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
@ -1758,7 +1758,7 @@ eng_preload_make_current(void *data, void *doit)
|
|||
{
|
||||
ERR("glXMakeContextCurrent(%p, None, NULL) failed",
|
||||
ob->info->info.display);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("__glXMakeContextCurrent");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
@ -1888,7 +1888,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
|
|||
{
|
||||
glsym_glXBindTexImage(eng_get_ob(re)->disp, n->glx_pixmap,
|
||||
GLX_FRONT_LEFT_EXT, NULL);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glXBindTexImage");
|
||||
}
|
||||
else
|
||||
ERR("Try glXBindTexImage on GLX with no support");
|
||||
|
@ -1898,7 +1898,6 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
|
|||
else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, n->ns.data.opengl.texture_id);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
|
||||
{
|
||||
|
@ -1936,7 +1935,6 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
|
|||
{
|
||||
glsym_glXReleaseTexImage(eng_get_ob(re)->disp, n->glx_pixmap,
|
||||
GLX_FRONT_LEFT_EXT);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
ERR("Try glXReleaseTexImage on GLX with no support");
|
||||
|
@ -1946,7 +1944,6 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
|
|||
else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
|
||||
{
|
||||
|
@ -1993,7 +1990,6 @@ _native_free_cb(void *data, void *image)
|
|||
{
|
||||
glsym_glXReleaseTexImage(eng_get_ob(re)->disp, n->glx_pixmap,
|
||||
GLX_FRONT_LEFT_EXT);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
else
|
||||
ERR("Try glXReleaseTexImage on GLX with no support");
|
||||
|
@ -2001,7 +1997,7 @@ _native_free_cb(void *data, void *image)
|
|||
if (glsym_glXDestroyPixmap)
|
||||
{
|
||||
glsym_glXDestroyPixmap(eng_get_ob(re)->disp, n->glx_pixmap);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
GLERRV("glsym_glXDestroyPixmap");
|
||||
}
|
||||
else
|
||||
ERR("Try glXDestroyPixmap on GLX with no support");
|
||||
|
|
|
@ -791,7 +791,6 @@ _native_cb_bind(void *data EINA_UNUSED, void *image)
|
|||
if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, n->ns.data.opengl.texture_id);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -807,7 +806,6 @@ _native_cb_unbind(void *data EINA_UNUSED, void *image)
|
|||
if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue