mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nv50: fix instancing of client-side vertex buffers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8396>
This commit is contained in:
parent
73fa50452c
commit
f763d0f195
1 changed files with 4 additions and 3 deletions
|
|
@ -189,9 +189,10 @@ nv50_user_vbuf_range(struct nv50_context *nv50, unsigned vbi,
|
|||
{
|
||||
assert(vbi < PIPE_MAX_ATTRIBS);
|
||||
if (unlikely(nv50->vertex->instance_bufs & (1 << vbi))) {
|
||||
/* TODO: use min and max instance divisor to get a proper range */
|
||||
*base = 0;
|
||||
*size = nv50->vtxbuf[vbi].buffer.resource->width0;
|
||||
const uint32_t div = nv50->vertex->min_instance_div[vbi];
|
||||
*base = nv50->instance_off * nv50->vtxbuf[vbi].stride;
|
||||
*size = (nv50->instance_max / div) * nv50->vtxbuf[vbi].stride +
|
||||
nv50->vertex->vb_access_size[vbi];
|
||||
} else {
|
||||
/* NOTE: if there are user buffers, we *must* have index bounds */
|
||||
assert(nv50->vb_elt_limit != ~0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue