From 3313d693af28ee099aae8ac6e34ad007e007de84 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 13 Oct 2018 13:51:33 -0400 Subject: [PATCH] freedreno/a6xx: split VBO state into binning/draw variants Blob seems to manage to use same input registers for BS (binning pass) vs VS (draw pass) shaders, so it can use the same VBO state for both. We can't quite do that yet, so split them. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 7 ++++++- src/gallium/drivers/freedreno/a6xx/fd6_emit.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index a8701b44f3d..518168e51bc 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -127,7 +127,11 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring, struct fd_ringbuffer *state; state = fd6_build_vbo_state(emit, emit->vs); - fd6_emit_add_group(emit, state, FD6_GROUP_VBO, 0x7); + fd6_emit_add_group(emit, state, FD6_GROUP_VBO, 0x6); + fd_ringbuffer_del(state); + + state = fd6_build_vbo_state(emit, emit->bs); + fd6_emit_add_group(emit, state, FD6_GROUP_VBO_BINNING, 0x1); fd_ringbuffer_del(state); } @@ -233,6 +237,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info, fd6_ctx->prog = fd6_emit_get_prog(&emit); } + emit.bs = fd6_emit_get_prog(&emit)->bs; emit.vs = fd6_emit_get_prog(&emit)->vs; emit.fs = fd6_emit_get_prog(&emit)->fs; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h index 83d0ede82ff..7a308352aac 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h @@ -47,6 +47,7 @@ enum fd6_state_id { FD6_GROUP_ZSA, FD6_GROUP_ZSA_BINNING, FD6_GROUP_VBO, + FD6_GROUP_VBO_BINNING, FD6_GROUP_VS_CONST, FD6_GROUP_FS_CONST, FD6_GROUP_VS_TEX, @@ -82,6 +83,7 @@ struct fd6_emit { /* cached to avoid repeated lookups: */ const struct fd6_program_state *prog; + struct ir3_shader_variant *bs; struct ir3_shader_variant *vs; struct ir3_shader_variant *fs; -- 2.30.2