[Glamor] [PATCH 32/34] glamor: Fix requested composite VBO size.

Alex Deucher alexdeucher at gmail.com
Fri Feb 28 10:02:27 PST 2014


From: Eric Anholt <eric at anholt.net>

The argument to setup_composte_vbo is the number of verts.

Ported from Eric's xserver glamor tree.

Signed-off-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 src/glamor_render.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/glamor_render.c b/src/glamor_render.c
index aa8f99c..a2141be 100644
--- a/src/glamor_render.c
+++ b/src/glamor_render.c
@@ -1330,15 +1330,14 @@ 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;
 		int vb_stride;
 
 		mrect = nrect > nrect_max ? nrect_max : nrect ;
-		glamor_setup_composite_vbo(screen, mrect * vert_stride);
+		glamor_setup_composite_vbo(screen, mrect * 4);
 		rect_processed = mrect;
 		vb_stride = glamor_priv->vb_stride/sizeof(float);
 		while (mrect--) {
-- 
1.8.3.1



More information about the Glamor mailing list