freedreno/a6xx: add PROG_FB_RAST stateobj
authorRob Clark <robdclark@chromium.org>
Thu, 16 Jan 2020 23:14:19 +0000 (15:14 -0800)
committerRob Clark <robdclark@chromium.org>
Fri, 17 Jan 2020 23:43:51 +0000 (15:43 -0800)
For the handful of registers that depend on the union of program/
framebuffer/rasterizer state.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3435>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3435>

src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_emit.h

index d6535ea580ced864f6b8be8ac85c1b81afd3316f..7b1b88cee7e421c89fe56664f89f65cbf8e82aa9 100644 (file)
@@ -1030,6 +1030,9 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
        }
 
        if (dirty & (FD_DIRTY_FRAMEBUFFER | FD_DIRTY_RASTERIZER | FD_DIRTY_PROG)) {
+               struct fd_ringbuffer *ring = fd_submit_new_ringbuffer(
+                               emit->ctx->batch->submit, 5 * 4, FD_RINGBUFFER_STREAMING);
+
                unsigned nr = pfb->nr_cbufs;
 
                if (ctx->rasterizer->rasterizer_discard)
@@ -1043,6 +1046,8 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
 
                OUT_PKT4(ring, REG_A6XX_SP_FS_OUTPUT_CNTL1, 1);
                OUT_RING(ring, A6XX_SP_FS_OUTPUT_CNTL1_MRT(nr));
+
+               fd6_emit_take_group(emit, ring, FD6_GROUP_PROG_FB_RAST, ENABLE_DRAW);
        }
 
        fd6_emit_consts(emit, vs, PIPE_SHADER_VERTEX, FD6_GROUP_VS_CONST, ENABLE_ALL);
index 5d03761c7acf1edf6859a5c5377bb8ebad29d0fe..04674c7c8333da103e6a978bba66f196630ba61f 100644 (file)
@@ -47,6 +47,7 @@ enum fd6_state_id {
        FD6_GROUP_PROG,
        FD6_GROUP_PROG_BINNING,
        FD6_GROUP_PROG_INTERP,
+       FD6_GROUP_PROG_FB_RAST,
        FD6_GROUP_LRZ,
        FD6_GROUP_LRZ_BINNING,
        FD6_GROUP_VBO,