gallium: remove pipe_index_buffer and set_index_buffer
[mesa.git] / src / gallium / drivers / freedreno / a4xx / fd4_draw.c
index a76f9e8c4347d1570f2cca5d98028c19b51d093a..840e9171b32550bc1939a176f898a37c54fec709 100644 (file)
@@ -44,7 +44,7 @@
 
 static void
 draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
-               struct fd4_emit *emit)
+               struct fd4_emit *emit, unsigned index_offset)
 {
        const struct pipe_draw_info *info = emit->info;
        enum pc_di_primtype primtype = ctx->primtypes[info->mode];
@@ -55,7 +55,7 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
                fd4_emit_vertex_bufs(ring, emit);
 
        OUT_PKT0(ring, REG_A4XX_VFD_INDEX_OFFSET, 2);
-       OUT_RING(ring, info->indexed ? info->index_bias : info->start); /* VFD_INDEX_OFFSET */
+       OUT_RING(ring, info->index_size ? info->index_bias : info->start); /* VFD_INDEX_OFFSET */
        OUT_RING(ring, info->start_instance);   /* ??? UNKNOWN_2209 */
 
        OUT_PKT0(ring, REG_A4XX_PC_RESTART_INDEX, 1);
@@ -70,7 +70,7 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
 
        fd4_draw_emit(ctx->batch, ring, primtype,
                        emit->key.binning_pass ? IGNORE_VISIBILITY : USE_VISIBILITY,
-                       info);
+                       info, index_offset);
 }
 
 /* fixup dirty shader state in case some "unrelated" (from the state-
@@ -99,7 +99,8 @@ fixup_shader_state(struct fd_context *ctx, struct ir3_shader_key *key)
 }
 
 static bool
-fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
+fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
+             unsigned index_offset)
 {
        struct fd4_context *fd4_ctx = fd4_context(ctx);
        struct fd4_emit emit = {
@@ -153,7 +154,7 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
                OUT_RING(ring, A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
        }
 
-       draw_impl(ctx, ctx->batch->draw, &emit);
+       draw_impl(ctx, ctx->batch->draw, &emit, index_offset);
 
        if (ctx->rasterizer->rasterizer_discard) {
                fd_wfi(ctx->batch, ring);
@@ -168,7 +169,7 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
        emit.dirty = dirty & ~(FD_DIRTY_BLEND);
        emit.vp = NULL;   /* we changed key so need to refetch vp */
        emit.fp = NULL;
-       draw_impl(ctx, ctx->batch->binning, &emit);
+       draw_impl(ctx, ctx->batch->binning, &emit, index_offset);
 
        fd_context_all_clean(ctx);