freedreno/a6xx: move immediates to program stateobj
authorRob Clark <robdclark@chromium.org>
Thu, 1 Aug 2019 15:35:14 +0000 (08:35 -0700)
committerRob Clark <robdclark@chromium.org>
Tue, 13 Aug 2019 15:11:26 +0000 (08:11 -0700)
Signed-off-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_program.c

index 69d0c3eee95ebaeb015054a298f3fe260f667af4..7b858106910cc0654276d09fb1f064ef5be67f46 100644 (file)
@@ -938,7 +938,6 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
                                &ctx->constbuf[PIPE_SHADER_VERTEX]);
                ir3_emit_ubos(ctx->screen, vp, vsconstobj,
                                &ctx->constbuf[PIPE_SHADER_VERTEX]);
-               ir3_emit_immediates(ctx->screen, vp, vsconstobj);
                ir3_emit_ssbo_sizes(ctx->screen, vp, vsconstobj,
                                &ctx->shaderbuf[PIPE_SHADER_VERTEX]);
                ir3_emit_image_dims(ctx->screen, vp, vsconstobj,
@@ -959,7 +958,6 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
                                &ctx->constbuf[PIPE_SHADER_FRAGMENT]);
                ir3_emit_ubos(ctx->screen, fp, fsconstobj,
                                &ctx->constbuf[PIPE_SHADER_FRAGMENT]);
-               ir3_emit_immediates(ctx->screen, fp, fsconstobj);
                ir3_emit_ssbo_sizes(ctx->screen, fp, fsconstobj,
                                &ctx->shaderbuf[PIPE_SHADER_FRAGMENT]);
                ir3_emit_image_dims(ctx->screen, fp, fsconstobj,
index 7714f569f9685152bcf3a2254cdce2e3c0396b1b..3aa91c312b32ed39a3d8eddf510d4ace95f1e8cc 100644 (file)
@@ -251,8 +251,9 @@ next_regid(uint32_t reg, uint32_t increment)
 }
 
 static void
-setup_stateobj(struct fd_ringbuffer *ring, struct fd6_program_state *state,
-               const struct ir3_shader_key *key, bool binning_pass)
+setup_stateobj(struct fd_ringbuffer *ring, struct fd_screen *screen,
+               struct fd6_program_state *state, const struct ir3_shader_key *key,
+               bool binning_pass)
 {
        uint32_t pos_regid, psize_regid, color_regid[8], posz_regid;
        uint32_t face_regid, coord_regid, zwcoord_regid, samp_id_regid;
@@ -585,6 +586,10 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd6_program_state *state,
 
        OUT_PKT4(ring, REG_A6XX_GRAS_SU_DEPTH_PLANE_CNTL, 1);
        OUT_RING(ring, COND(fragz, A6XX_GRAS_SU_DEPTH_PLANE_CNTL_FRAG_WRITES_Z));
+
+       ir3_emit_immediates(screen, vs, ring);
+       if (!binning_pass)
+               ir3_emit_immediates(screen, fs, ring);
 }
 
 /* emits the program state which is not part of the stateobj because of
@@ -699,8 +704,8 @@ fd6_program_create(void *data, struct ir3_shader_variant *bs,
        state->stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
 
        setup_config_stateobj(state->config_stateobj, state);
-       setup_stateobj(state->binning_stateobj, state, key, true);
-       setup_stateobj(state->stateobj, state, key, false);
+       setup_stateobj(state->binning_stateobj, ctx->screen, state, key, true);
+       setup_stateobj(state->stateobj, ctx->screen, state, key, false);
 
        return &state->base;
 }