From f40f8bcf07bd7f496bfd3069eddfcbeb3d1bf8be Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 5 Dec 2010 00:26:22 +0000 Subject: [PATCH] i965: Check for potential vertex array overflow every time There was a reason why we need to check at the start of every composite operation to see if we have enough space in the array to fit the vertices, which I promptly forgot when moving the code around to make it look pretty. * sigh. Signed-off-by: Chris Wilson --- src/i965_render.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/i965_render.c b/src/i965_render.c index 2e1c3f78..659e2d14 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -1836,19 +1836,19 @@ i965_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY, i965_emit_composite_state(scrn); } - if (intel->vertex_offset == 0) { - if (intel->vertex_used && - intel->floats_per_vertex != intel->last_floats_per_vertex) { - intel->vertex_index = (intel->vertex_used + intel->floats_per_vertex - 1) / intel->floats_per_vertex; - intel->vertex_used = intel->vertex_index * intel->floats_per_vertex; - } - if (intel->floats_per_vertex != intel->last_floats_per_vertex || - intel_vertex_space(intel) < 3*4*intel->floats_per_vertex) { - intel_next_vertex(intel); - i965_select_vertex_buffer(intel); - intel->vertex_index = 0; - } + if (intel->vertex_used && + intel->floats_per_vertex != intel->last_floats_per_vertex) { + intel->vertex_index = (intel->vertex_used + intel->floats_per_vertex - 1) / intel->floats_per_vertex; + intel->vertex_used = intel->vertex_index * intel->floats_per_vertex; + } + if (intel->floats_per_vertex != intel->last_floats_per_vertex || + intel_vertex_space(intel) < 3*4*intel->floats_per_vertex) { + intel_next_vertex(intel); + i965_select_vertex_buffer(intel); + intel->vertex_index = 0; + } + if (intel->vertex_offset == 0) { OUT_BATCH(BRW_3DPRIMITIVE | BRW_3DPRIMITIVE_VERTEX_SEQUENTIAL | (_3DPRIM_RECTLIST << BRW_3DPRIMITIVE_TOPOLOGY_SHIFT) |