Keith Packard <[email protected]> writes: > This accelerates poly_fill_rect using GPU-based geometry computation > > Signed-off-by: Keith Packard <[email protected]>
I applied the same quads fix as for spans:
diff --git a/glamor/glamor_rects.c b/glamor/glamor_rects.c
index 8b50129..7731ede 100644
--- a/glamor/glamor_rects.c
+++ b/glamor/glamor_rects.c
@@ -23,7 +23,6 @@
#include "glamor_priv.h"
#include "glamor_program.h"
#include "glamor_transform.h"
-#include "glamor_prepare.h"
static const glamor_facet glamor_facet_polyfillrect_130 = {
.name = "poly_fill_rect",
@@ -126,14 +125,23 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
box++;
if (glamor_priv->glsl_version >= 130)
glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, nrect);
- else
- glDrawArrays(GL_QUADS, 0, nrect * 4);
+ else {
+ if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
+ glDrawArrays(GL_QUADS, 0, nrect * 4);
+ } else {
+ int i;
+ for (i = 0; i < nrect; i++) {
+ glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4);
+ }
+ }
+ }
}
}
glDisable(GL_SCISSOR_TEST);
glDisable(GL_COLOR_LOGIC_OP);
- glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0);
+ if (glamor_priv->glsl_version >= 130)
+ glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
glamor_put_context(glamor_priv);
pgpblnpWWBzoC.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
