summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-01-01 19:11:25 +0100
committerMarek Olšák <[email protected]>2012-01-05 18:29:11 +0100
commitdbd60d27e8087a3bacf36d4eceef15dc4fcdccee (patch)
tree1f44a532dfda834224ace8e48ba8f126834ad546 /src
parentf94d390213308d4aca1515c75acc6865ebb45796 (diff)
u_vbuf: take start_instance into account when uploading instanced attribs
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_vbuf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 943336d8484..a7266136ebf 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -539,7 +539,7 @@ void u_vbuf_set_index_buffer(struct u_vbuf *mgr,
static void
u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
int min_index, int max_index,
- unsigned instance_count)
+ unsigned start_instance, unsigned instance_count)
{
unsigned i;
unsigned count = max_index + 1 - min_index;
@@ -577,6 +577,7 @@ u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
} else if (instance_div) {
/* Per-instance attrib. */
unsigned count = (instance_count + instance_div - 1) / instance_div;
+ first += vb->stride * start_instance;
size = vb->stride * (count - 1) + mgr->ve->src_format_size[i];
} else {
/* Per-vertex attrib. */
@@ -838,7 +839,8 @@ u_vbuf_draw_begin(struct u_vbuf *mgrb,
/* Upload user buffers. */
if (mgr->any_user_vbs) {
- u_vbuf_upload_buffers(mgr, min_index, max_index, info->instance_count);
+ u_vbuf_upload_buffers(mgr, min_index, max_index,
+ info->start_instance, info->instance_count);
}
return U_VBUF_BUFFERS_UPDATED;
}