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/nvc0 | |
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/nvc0')
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c index 20b6742d8d7..fd2bcbb961c 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c @@ -19,6 +19,7 @@ struct push_context { uint32_t vertex_size; uint32_t restart_index; + uint32_t start_instance; uint32_t instance_id; bool prim_restart; @@ -44,6 +45,7 @@ nvc0_push_context_init(struct nvc0_context *nvc0, struct push_context *ctx) ctx->translate = nvc0->vertex->translate; ctx->vertex_size = nvc0->vertex->size; + ctx->instance_id = 0; ctx->need_vertex_id = nvc0->vertprog->vp.need_vertex_id && (nvc0->vertex->num_elements < 32); @@ -246,7 +248,8 @@ disp_vertices_i08(struct push_context *ctx, unsigned start, unsigned count) 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; @@ -302,7 +305,8 @@ disp_vertices_i16(struct push_context *ctx, unsigned start, unsigned count) 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; @@ -358,7 +362,8 @@ disp_vertices_i32(struct push_context *ctx, unsigned start, unsigned count) 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; @@ -410,7 +415,8 @@ disp_vertices_seq(struct push_context *ctx, unsigned start, unsigned count) /* 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; @@ -515,7 +521,7 @@ nvc0_push_vbo(struct nvc0_context *nvc0, const struct pipe_draw_info *info) index_size = 0; } - ctx.instance_id = info->start_instance; + ctx.start_instance = info->start_instance; prim = nvc0_prim_gl(info->mode); do { |