panfrost: Simplify get_fresh_batch_for_fbo
Makes the code easier to read, too. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12525>
This commit is contained in:
parent
81a76d9e42
commit
9307028255
|
@ -222,21 +222,15 @@ panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx, const char *reaso
|
||||||
batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer);
|
batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer);
|
||||||
panfrost_dirty_state_all(ctx);
|
panfrost_dirty_state_all(ctx);
|
||||||
|
|
||||||
/* The batch has no draw/clear queued, let's return it directly.
|
/* We only need to submit and get a fresh batch if there is no
|
||||||
* Note that it's perfectly fine to re-use a batch with an
|
* draw/clear queued. Otherwise we may reuse the batch. */
|
||||||
* existing clear, we'll just update it with the new clear request.
|
|
||||||
*/
|
if (batch->scoreboard.first_job) {
|
||||||
if (!batch->scoreboard.first_job) {
|
perf_debug_ctx(ctx, "Flushing the current FBO due to: %s", reason);
|
||||||
ctx->batch = batch;
|
panfrost_batch_submit(batch, 0, 0);
|
||||||
return batch;
|
batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, we need to freeze the existing one and instantiate a new
|
|
||||||
* one.
|
|
||||||
*/
|
|
||||||
perf_debug_ctx(ctx, "Flushing the current FBO due to: %s", reason);
|
|
||||||
panfrost_batch_submit(batch, 0, 0);
|
|
||||||
batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer);
|
|
||||||
ctx->batch = batch;
|
ctx->batch = batch;
|
||||||
return batch;
|
return batch;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue