diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h index a71afe6408..6155f1e8db 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h @@ -640,7 +640,7 @@ extern unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b); extern unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d); #endif -#define GL_ERRORS 1 +//#define GL_ERRORS 1 #ifdef GL_ERRORS # define GLERR(fn, fl, ln, op) \ diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c index 7ee41eef6d..49551f5220 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c @@ -1,5 +1,6 @@ #include "evas_gl_private.h" +#define PRG_INVALID 0xffffffff #define GLPIPES 1 static int sym_done = 0; @@ -454,7 +455,9 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc) GLERR(__FUNCTION__, __FILE__, __LINE__, ""); } - glUseProgram(gc->state.current.cur_prog); + 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__, ""); } @@ -703,7 +706,9 @@ evas_gl_common_context_new(void) SHADER_TEXTURE_ADD(shared, IMG_MASK, tex); SHADER_TEXTURE_ADD(shared, IMG_MASK, texm); - glUseProgram(gc->state.current.cur_prog); + 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__, ""); evas_gl_common_shader_program_init_done(); @@ -891,7 +896,9 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc) GLERR(__FUNCTION__, __FILE__, __LINE__, ""); glEnableVertexAttribArray(SHAD_COLOR); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); - glUseProgram(gc->state.current.cur_prog); + 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); @@ -922,7 +929,7 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, evas_gl_common_context_flush(gc); - gc->state.current.cur_prog = -1; + gc->state.current.cur_prog = PRG_INVALID; gc->state.current.cur_tex = -1; gc->state.current.cur_texu = -1; gc->state.current.cur_texv = -1;