mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
u_vbuf: take start_instance into account when uploading instanced attribs
This commit is contained in:
parent
f94d390213
commit
dbd60d27e8
1 changed files with 4 additions and 2 deletions
|
|
@ -539,7 +539,7 @@ void u_vbuf_set_index_buffer(struct u_vbuf *mgr,
|
||||||
static void
|
static void
|
||||||
u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
|
u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
|
||||||
int min_index, int max_index,
|
int min_index, int max_index,
|
||||||
unsigned instance_count)
|
unsigned start_instance, unsigned instance_count)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned count = max_index + 1 - min_index;
|
unsigned count = max_index + 1 - min_index;
|
||||||
|
|
@ -577,6 +577,7 @@ u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
|
||||||
} else if (instance_div) {
|
} else if (instance_div) {
|
||||||
/* Per-instance attrib. */
|
/* Per-instance attrib. */
|
||||||
unsigned count = (instance_count + instance_div - 1) / instance_div;
|
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];
|
size = vb->stride * (count - 1) + mgr->ve->src_format_size[i];
|
||||||
} else {
|
} else {
|
||||||
/* Per-vertex attrib. */
|
/* Per-vertex attrib. */
|
||||||
|
|
@ -838,7 +839,8 @@ u_vbuf_draw_begin(struct u_vbuf *mgrb,
|
||||||
|
|
||||||
/* Upload user buffers. */
|
/* Upload user buffers. */
|
||||||
if (mgr->any_user_vbs) {
|
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;
|
return U_VBUF_BUFFERS_UPDATED;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue