freedreno/a6xx: split VBO state into binning/draw variants
authorRob Clark <robdclark@gmail.com>
Sat, 13 Oct 2018 17:51:33 +0000 (13:51 -0400)
committerRob Clark <robdclark@gmail.com>
Wed, 17 Oct 2018 16:44:49 +0000 (12:44 -0400)
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 <robdclark@gmail.com>
src/gallium/drivers/freedreno/a6xx/fd6_draw.c
src/gallium/drivers/freedreno/a6xx/fd6_emit.h

index a8701b44f3dcb80f6c76f114a37c492a87052129..518168e51bc69fa187ff69fbf13e8c816ba65dec 100644 (file)
@@ -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;
 
index 83d0ede82fffe98fbd97ceb89f0e1cd9358d3543..7a308352aac3cdfa25c869a56b3257d68445e438 100644 (file)
@@ -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;