if (vb->buffer && svga_buffer_is_user_buffer(vb->buffer)) {
struct svga_buffer *buffer = svga_buffer(vb->buffer);
+ /* The buffer_offset is relative to the uploaded buffer.
+ * Since we're discarding that buffer we need to reset this offset
+ * so it's not inadvertantly applied to a subsequent draw.
+ *
+ * XXX a root problem here is that the svga->curr.vb[] information
+ * is getting set both by gallium API calls and by code in
+ * svga_upload_user_buffers(). We should instead have two copies
+ * of the vertex buffer information and choose between as needed.
+ */
+ vb->buffer_offset = 0;
+
buffer->uploaded.start = ~0;
buffer->uploaded.end = 0;
if (buffer->uploaded.buffer)