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.
This commit is contained in:
Carsten Haitzler 2013-05-03 23:25:15 +09:00
parent 1a81f0a8c2
commit e0a78afef0
1 changed files with 18 additions and 3 deletions

View File

@ -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);
}
}