diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-05 00:26:22 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-05 00:28:11 +0000 |
commit | f40f8bcf07bd7f496bfd3069eddfcbeb3d1bf8be (patch) | |
tree | 4a98d1f32c797c4e1b0ca8d5e8aac8fcb39e0c09 /src/i965_render.c | |
parent | 55c5f1876e2329a938955967f5d45c814e50beb5 (diff) |
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>
Diffstat (limited to 'src/i965_render.c')
-rw-r--r-- | src/i965_render.c | 24 |
1 files 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) | |