The argument to setup_composte_vbo is the number of verts.

Signed-off-by: Eric Anholt <[email protected]>
---
 glamor/glamor_render.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 7829977..63bddfd 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1253,8 +1253,7 @@ glamor_composite_with_shader(CARD8 op,
         vert_stride += 4;
     }
 
-    nrect_max = (vert_stride * nrect) > GLAMOR_COMPOSITE_VBO_VERT_CNT ?
-        (GLAMOR_COMPOSITE_VBO_VERT_CNT / vert_stride) : nrect;
+    nrect_max = MIN(nrect, GLAMOR_COMPOSITE_VBO_VERT_CNT / 4);
 
     while (nrect) {
         int mrect, rect_processed;
@@ -1262,7 +1261,7 @@ glamor_composite_with_shader(CARD8 op,
         float *vertices;
 
         mrect = nrect > nrect_max ? nrect_max : nrect;
-        vertices = glamor_setup_composite_vbo(screen, mrect * vert_stride);
+        vertices = glamor_setup_composite_vbo(screen, mrect * 4);
         rect_processed = mrect;
         vb_stride = glamor_priv->vb_stride / sizeof(float);
         while (mrect--) {
-- 
1.9.0

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to