The start instance is applied as an offset into the buffer directly,
ignoring the divisor, not as an instance id offset that respects the
divisor.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
uint32_t prim;
uint32_t restart_index;
uint32_t prim;
uint32_t restart_index;
+ uint32_t start_instance;
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
- ctx->translate->run_elts8(ctx->translate, elts, nr, 0, ctx->instance_id,
+ ctx->translate->run_elts8(ctx->translate, elts, nr,
+ ctx->start_instance, ctx->instance_id,
ctx->push->cur);
ctx->push->cur += size;
ctx->push->cur);
ctx->push->cur += size;
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
- ctx->translate->run_elts16(ctx->translate, elts, nr, 0, ctx->instance_id,
+ ctx->translate->run_elts16(ctx->translate, elts, nr,
+ ctx->start_instance, ctx->instance_id,
ctx->push->cur);
ctx->push->cur += size;
ctx->push->cur);
ctx->push->cur += size;
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
- ctx->translate->run_elts(ctx->translate, elts, nr, 0, ctx->instance_id,
+ ctx->translate->run_elts(ctx->translate, elts, nr,
+ ctx->start_instance, ctx->instance_id,
ctx->push->cur);
ctx->push->cur += size;
ctx->push->cur);
ctx->push->cur += size;
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
- ctx->translate->run(ctx->translate, start, push, 0, ctx->instance_id,
+ ctx->translate->run(ctx->translate, start, push,
+ ctx->start_instance, ctx->instance_id,
ctx->push->cur);
ctx->push->cur += size;
count -= push;
ctx->push->cur);
ctx->push->cur += size;
count -= push;
ctx.need_vertex_id = nv50->screen->base.class_3d >= NV84_3D_CLASS &&
nv50->vertprog->vp.need_vertex_id && (nv50->vertex->num_elements < 32);
ctx.index_bias = info->index_bias;
ctx.need_vertex_id = nv50->screen->base.class_3d >= NV84_3D_CLASS &&
nv50->vertprog->vp.need_vertex_id && (nv50->vertex->num_elements < 32);
ctx.index_bias = info->index_bias;
/* For indexed draws, gl_VertexID must be emitted for every vertex. */
ctx.packet_vertex_limit =
/* For indexed draws, gl_VertexID must be emitted for every vertex. */
ctx.packet_vertex_limit =
- ctx.instance_id = info->start_instance;
+ ctx.start_instance = info->start_instance;
ctx.prim = nv50_prim_gl(info->mode);
if (info->primitive_restart) {
ctx.prim = nv50_prim_gl(info->mode);
if (info->primitive_restart) {
uint32_t vertex_size;
uint32_t restart_index;
uint32_t vertex_size;
uint32_t restart_index;
+ uint32_t start_instance;
uint32_t instance_id;
bool prim_restart;
uint32_t instance_id;
bool prim_restart;
ctx->translate = nvc0->vertex->translate;
ctx->vertex_size = nvc0->vertex->size;
ctx->translate = nvc0->vertex->translate;
ctx->vertex_size = nvc0->vertex->size;
ctx->need_vertex_id =
nvc0->vertprog->vp.need_vertex_id && (nvc0->vertex->num_elements < 32);
ctx->need_vertex_id =
nvc0->vertprog->vp.need_vertex_id && (nvc0->vertex->num_elements < 32);
if (unlikely(ctx->prim_restart))
nR = prim_restart_search_i08(elts, nR, ctx->restart_index);
if (unlikely(ctx->prim_restart))
nR = prim_restart_search_i08(elts, nR, ctx->restart_index);
- translate->run_elts8(translate, elts, nR, 0, ctx->instance_id, ctx->dest);
+ translate->run_elts8(translate, elts, nR,
+ ctx->start_instance, ctx->instance_id, ctx->dest);
count -= nR;
ctx->dest += nR * ctx->vertex_size;
count -= nR;
ctx->dest += nR * ctx->vertex_size;
if (unlikely(ctx->prim_restart))
nR = prim_restart_search_i16(elts, nR, ctx->restart_index);
if (unlikely(ctx->prim_restart))
nR = prim_restart_search_i16(elts, nR, ctx->restart_index);
- translate->run_elts16(translate, elts, nR, 0, ctx->instance_id, ctx->dest);
+ translate->run_elts16(translate, elts, nR,
+ ctx->start_instance, ctx->instance_id, ctx->dest);
count -= nR;
ctx->dest += nR * ctx->vertex_size;
count -= nR;
ctx->dest += nR * ctx->vertex_size;
if (unlikely(ctx->prim_restart))
nR = prim_restart_search_i32(elts, nR, ctx->restart_index);
if (unlikely(ctx->prim_restart))
nR = prim_restart_search_i32(elts, nR, ctx->restart_index);
- translate->run_elts(translate, elts, nR, 0, ctx->instance_id, ctx->dest);
+ translate->run_elts(translate, elts, nR,
+ ctx->start_instance, ctx->instance_id, ctx->dest);
count -= nR;
ctx->dest += nR * ctx->vertex_size;
count -= nR;
ctx->dest += nR * ctx->vertex_size;
/* XXX: This will read the data corresponding to the primitive restart index,
* maybe we should avoid that ?
*/
/* XXX: This will read the data corresponding to the primitive restart index,
* maybe we should avoid that ?
*/
- translate->run(translate, start, count, 0, ctx->instance_id, ctx->dest);
+ translate->run(translate, start, count,
+ ctx->start_instance, ctx->instance_id, ctx->dest);
do {
unsigned nr = count;
do {
unsigned nr = count;
- ctx.instance_id = info->start_instance;
+ ctx.start_instance = info->start_instance;
prim = nvc0_prim_gl(info->mode);
do {
prim = nvc0_prim_gl(info->mode);
do {