freedreno/a6xx: limit PROG_FB_RAST state emit

The dependency on RASTERIZER state is only when rasterizer_discard
changes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813>
This commit is contained in:
Rob Clark
2020-04-16 14:33:50 -07:00
committed by Marge Bot
parent 46e177389f
commit 3c268afd29
3 changed files with 10 additions and 2 deletions
@@ -1053,7 +1053,7 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
FD6_GROUP_RASTERIZER, ENABLE_ALL);
}
if (dirty & (FD_DIRTY_FRAMEBUFFER | FD_DIRTY_RASTERIZER | FD_DIRTY_PROG)) {
if (dirty & (FD_DIRTY_FRAMEBUFFER | FD_DIRTY_RASTERIZER_DISCARD | FD_DIRTY_PROG)) {
struct fd_ringbuffer *ring = fd_submit_new_ringbuffer(
emit->ctx->batch->submit, 5 * 4, FD_RINGBUFFER_STREAMING);
@@ -131,7 +131,6 @@ enum fd_dirty_3d_state {
FD_DIRTY_VTXSTATE = BIT(9),
FD_DIRTY_VTXBUF = BIT(10),
FD_DIRTY_MIN_SAMPLES = BIT(11),
FD_DIRTY_SCISSOR = BIT(12),
FD_DIRTY_STREAMOUT = BIT(13),
FD_DIRTY_UCP = BIT(14),
@@ -148,6 +147,11 @@ enum fd_dirty_3d_state {
/* only used by a2xx.. possibly can be removed.. */
FD_DIRTY_TEXSTATE = BIT(21),
/* fine grained state changes, for cases where state is not orthogonal
* from hw perspective:
*/
FD_DIRTY_RASTERIZER_DISCARD = BIT(24),
};
/* per shader-stage dirty state: */
@@ -395,6 +395,7 @@ fd_rasterizer_state_bind(struct pipe_context *pctx, void *hwcso)
{
struct fd_context *ctx = fd_context(pctx);
struct pipe_scissor_state *old_scissor = fd_context_get_scissor(ctx);
bool discard = ctx->rasterizer && ctx->rasterizer->rasterizer_discard;
ctx->rasterizer = hwcso;
ctx->dirty |= FD_DIRTY_RASTERIZER;
@@ -406,6 +407,9 @@ fd_rasterizer_state_bind(struct pipe_context *pctx, void *hwcso)
*/
if (old_scissor != fd_context_get_scissor(ctx))
ctx->dirty |= FD_DIRTY_SCISSOR;
if (ctx->rasterizer && (discard != ctx->rasterizer->rasterizer_discard))
ctx->dirty |= FD_DIRTY_RASTERIZER_DISCARD;
}
static void