summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-06-10 20:19:01 -0700
committerEric Anholt <[email protected]>2011-06-18 15:20:36 -0700
commita5a36d9b158a317daa1cf10a6b6ed2bed6b22750 (patch)
tree1bbf274831df6d2bbaea025a5e71343fa617af12
parent5c2c60175d0e5da9b0e9688538b84dedf05107de (diff)
i965: Don't try to continue space before the start of a VBO.
This loop is trying to see if all the buffers to be uploaded happen to be the same increment from the start of the 3DSTATE_VERTEX_BUFFERS currently loaded in the hardware. However, we might be at a smaller offset than the previous set of VERTEX_BUFFERS, so we can't reuse because that packet made the first entry be its starting offset (you can't access outside the given bounds). Fixes piglit ARB_vertex_buffer_object/elements-negative-offset.
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 13d3aa7841c..32a1d297479 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -500,6 +500,8 @@ static void brw_prepare_vertices(struct brw_context *brw)
break;
d = brw->vb.buffers[i].offset - brw->vb.current_buffers[i].offset;
+ if (d < 0)
+ break;
if (i == 0)
delta = d / brw->vb.current_buffers[i].stride;
if (delta * brw->vb.current_buffers[i].stride != d)