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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2010-12-05 00:26:22 +00:00
parent 55c5f1876e
commit f40f8bcf07
1 changed files with 12 additions and 12 deletions

View File

@ -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) |