diff options
author | Ilia Mirkin <[email protected]> | 2016-06-18 21:54:37 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-06-21 21:50:16 -0400 |
commit | 1f4bca798dda155ad0615ba81d8373c771d1ec94 (patch) | |
tree | c6dc365b33f435ec0cd9b60acd2ffa4283530c73 /src/gallium/drivers/nouveau/nv50 | |
parent | 5b0d64886dfe9d42d02666ee1b07f2aa375197a5 (diff) |
nv50,nvc0: fix start_instance in manual push path
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 <[email protected]>
Cc: "11.2 12.0" <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_push.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_push.c b/src/gallium/drivers/nouveau/nv50/nv50_push.c index cbef95d07f6..6a53ad09768 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_push.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_push.c @@ -30,6 +30,7 @@ struct push_context { uint32_t prim; uint32_t restart_index; + uint32_t start_instance; uint32_t instance_id; }; @@ -85,7 +86,8 @@ emit_vertices_i08(struct push_context *ctx, unsigned start, unsigned count) 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; @@ -123,7 +125,8 @@ emit_vertices_i16(struct push_context *ctx, unsigned start, unsigned count) 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; @@ -161,7 +164,8 @@ emit_vertices_i32(struct push_context *ctx, unsigned start, unsigned count) 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; @@ -194,7 +198,8 @@ emit_vertices_seq(struct push_context *ctx, unsigned start, unsigned count) 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; @@ -247,6 +252,7 @@ nv50_push_vbo(struct nv50_context *nv50, const struct pipe_draw_info *info) 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.instance_id = 0; /* For indexed draws, gl_VertexID must be emitted for every vertex. */ ctx.packet_vertex_limit = @@ -301,7 +307,7 @@ nv50_push_vbo(struct nv50_context *nv50, const struct pipe_draw_info *info) ctx.restart_index = 0; } - ctx.instance_id = info->start_instance; + ctx.start_instance = info->start_instance; ctx.prim = nv50_prim_gl(info->mode); if (info->primitive_restart) { |