[Glamor] [PATCH 1/2] Change the trapezoid render to use VBO
Michel Dänzer
michel at daenzer.net
Tue Jul 17 02:00:42 PDT 2012
On Die, 2012-07-17 at 06:53 +0800, junyan.he at linux.intel.com wrote:
> From: Junyan He <junyan.he at linux.intel.com>
>
> Because some uniform variables need to be set for every
> trapezoid rendering, we can not use vbo to render multi
> trapezoids one time, which have performance big loss.
> We now add attributes which contain the same value to bypass
> the uniform variable problem. The uniform value for one
> trapezoid will be set to the same value to all the vertex
> of that trapezoid as an attribute, then in FS, it is still
> a constant.
>
> Signed-off-by: Junyan He <junyan.he at linux.intel.com>
[...]
> + dispatch->glBindBuffer(GL_ARRAY_BUFFER, glamor_priv->vbo);
> + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
> + dispatch->glBufferData(GL_ARRAY_BUFFER,
> + glamor_priv->vbo_size,
> + NULL, GL_DYNAMIC_DRAW);
> + glamor_priv->vb = dispatch->glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
> + }
Have you seen the recent changes to glamor_render.c, streaming vertex
data to larger VBOs? I wonder if the same technique could provide a
further speedup here as well. The VBO management code could probably be
shared between the two cases with some refactoring.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Debian, X and DRI developer
More information about the Glamor
mailing list