jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0c7857024b7c7043a7616c2d5a6de7484b63f07e
commit 0c7857024b7c7043a7616c2d5a6de7484b63f07e Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Mon Apr 13 15:28:16 2015 +0900 Evas GL common: Enable vertex arrays only when requested This should fix Dave's crash with the GL engine. Indeed the pointer to the color array is passed directly to the driver, without memcpy. Then, during glDrawArrays, the driver will try to address it... but it could as well be NULL or invalid. So, crashes would occur. Also mark use_vertex as always true. We keep this field only for the alloc() function. --- src/modules/evas/engines/gl_common/evas_gl_common.h | 2 +- src/modules/evas/engines/gl_common/evas_gl_context.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index e89f567..b81b913 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h @@ -511,7 +511,7 @@ struct _Evas_Engine_GL_Context GLfloat *texsam; GLfloat *mask; Eina_Bool line: 1; - Eina_Bool use_vertex : 1; + Eina_Bool use_vertex : 1; // always true Eina_Bool use_color : 1; Eina_Bool use_texuv : 1; Eina_Bool use_texuv2 : 1; diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index 12da9f9..93f118f 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -1742,7 +1742,7 @@ evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc, shader_array_flush(gc); gc->pipe[pn].array.line = 0; gc->pipe[pn].array.anti_alias = 0; - gc->pipe[pn].array.use_vertex = 0; + //gc->pipe[pn].array.use_vertex = 0; gc->pipe[pn].array.use_color = 0; gc->pipe[pn].array.use_texuv = 0; gc->pipe[pn].array.use_texuv2 = 0; @@ -3077,8 +3077,17 @@ shader_array_flush(Evas_Engine_GL_Context *gc) texsam_ptr = (unsigned char *)gc->pipe[i].array.texsam; mask_ptr = (unsigned char *)gc->pipe[i].array.mask; } + + // use_vertex is always true glVertexAttribPointer(SHAD_VERTEX, VERTEX_CNT, GL_SHORT, GL_FALSE, 0, vertex_ptr); - glVertexAttribPointer(SHAD_COLOR, COLOR_CNT, GL_UNSIGNED_BYTE, GL_TRUE, 0, color_ptr); + + if (gc->pipe[i].array.use_color) + { + glEnableVertexAttribArray(SHAD_COLOR); + glVertexAttribPointer(SHAD_COLOR, COLOR_CNT, GL_UNSIGNED_BYTE, GL_TRUE, 0, color_ptr); + } + else + glDisableVertexAttribArray(SHAD_COLOR); if (gc->pipe[i].array.line) { @@ -3338,7 +3347,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) if (gc->pipe[i].array.mask) free(gc->pipe[i].array.mask); gc->pipe[i].array.line = 0; - gc->pipe[i].array.use_vertex = 0; + //gc->pipe[i].array.use_vertex = 0; gc->pipe[i].array.use_color = 0; gc->pipe[i].array.use_texuv = 0; gc->pipe[i].array.use_texuv2 = 0; --