diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-05-03 23:25:15 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-05-03 23:25:15 +0900 |
commit | e0a78afef097ce95f6f3523f93dd6e75340e2efb (patch) | |
tree | 3bf0094ac49e57240cbdabd5ce9fe43edb0cf5d9 | |
parent | 1a81f0a8c205b89fd8d21e0e9033e6a04ae7cf4f (diff) | |
download | efl-e0a78afef097ce95f6f3523f93dd6e75340e2efb.tar.gz |
oh copying way too much data into vbo's... we copied alloc size not
num size.. and alloc size is much bigger as it makes room for 1024
quads per alloc increase (6*1024 vertexes etc.). literally this drops
e17's cpu usage while compositing stuff by 40%...at least in my test
case.
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_context.c | 21 |
1 files changed, 18 insertions, 3 deletions
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 2f7302771c..a269181829 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -909,6 +909,7 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc) if (getenv("EVAS_GL_DBG")) dbgflushnum = 1; } if (dbgflushnum) printf("----prev-flushnum: %i -----------------------------------\n", gc->flushnum); + fprintf(stderr, "------------------------\n"); gc->flushnum = 0; gc->state.current.cur_prog = 0; @@ -2817,9 +2818,9 @@ shader_array_flush(Evas_Engine_GL_Context *gc) { unsigned char *x; -# define VERTEX_SIZE (gc->pipe[i].array.alloc * sizeof(GLshort) * 3) -# define COLOR_SIZE (gc->pipe[i].array.alloc * sizeof(GLubyte) * 4) -# define TEX_SIZE (gc->pipe[i].array.alloc * sizeof(GLfloat) * 2) +# define VERTEX_SIZE (gc->pipe[i].array.num * sizeof(GLshort) * 3) +# define COLOR_SIZE (gc->pipe[i].array.num * sizeof(GLubyte) * 4) +# define TEX_SIZE (gc->pipe[i].array.num * sizeof(GLfloat) * 2) vertex_ptr = NULL; color_ptr = vertex_ptr + VERTEX_SIZE; texuv_ptr = color_ptr + COLOR_SIZE; @@ -2856,6 +2857,20 @@ shader_array_flush(Evas_Engine_GL_Context *gc) memcpy(x + (unsigned long)texm_ptr, gc->pipe[i].array.texm, TEX_SIZE); if (gc->pipe[i].array.use_texsam) memcpy(x + (unsigned long)texsam_ptr, gc->pipe[i].array.texsam, TEX_SIZE); +/* + fprintf(stderr, "copy %i bytes [%i/%i slots] [%i + %i + %i + %i + %i + %i + %i] <%i %i %i %i %i %i %i>\n", + (int)((unsigned char *)END_POINTER), + gc->pipe[i].array.num, + gc->pipe[i].array.alloc, + VERTEX_SIZE, COLOR_SIZE, TEX_SIZE, TEX_SIZE, TEX_SIZE, TEX_SIZE, TEX_SIZE, + gc->pipe[i].array.use_vertex, + gc->pipe[i].array.use_color, + gc->pipe[i].array.use_texuv, + gc->pipe[i].array.use_texuv2, + gc->pipe[i].array.use_texuv3, + gc->pipe[i].array.use_texm, + gc->pipe[i].array.use_texsam); + */ glsym_glUnmapBuffer(GL_ARRAY_BUFFER); } } |