i965: Reinstate max-index paranoia

Don't trust the applications not to reference beyond the end of the
vertex buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-02-22 11:19:32 +00:00
parent 3377faffcd
commit b4cbd2b312

View file

@ -550,7 +550,7 @@ static void brw_emit_vertices(struct brw_context *brw)
if (intel->gen >= 5) {
OUT_RELOC(buffer->bo, I915_GEM_DOMAIN_VERTEX, 0, buffer->bo->size - 1);
} else
OUT_BATCH(0);
OUT_BATCH(buffer->bo->size / buffer->stride);
OUT_BATCH(0); /* Instance data step rate */
brw->vb.current_buffers[i].handle = buffer->bo->handle;