[PATCH 11/20] glamor: Add glamor_program based poly_fill_rect

Eric Anholt eric at anholt.net
Thu Mar 20 15:16:11 PDT 2014


Keith Packard <keithp at keithp.com> writes:

> This accelerates poly_fill_rect using GPU-based geometry computation
>
> Signed-off-by: Keith Packard <keithp at keithp.com>

> diff --git a/glamor/glamor_rects.c b/glamor/glamor_rects.c
> new file mode 100644
> index 0000000..22bb313
> --- /dev/null
> +++ b/glamor/glamor_rects.c

> +
> +    /* Set up the vertex buffers for the points */
> +
> +    v = glamor_get_vbo_space(drawable->pScreen, nrect * (4 * sizeof (GLshort)), &vbo_offset);

Could we use sizeof(xRectangle) here, too?

> +
> +    glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
> +    glVertexAttribDivisor(GLAMOR_VERTEX_POS, 1);
> +    glVertexAttribPointer(GLAMOR_VERTEX_POS, 4, GL_SHORT, GL_FALSE,
> +                          4 * sizeof (GLshort), vbo_offset);
> +
> +    memcpy(v, prect, nrect * sizeof (xRectangle));
> +
> +    glamor_put_vbo_space(screen);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140320/6a07ff8d/attachment.sig>


More information about the xorg-devel mailing list