Stop open-coding and add a helper.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22895>
cleanup_submit(batch);
}
+void
+fd_batch_set_fb(struct fd_batch *batch, const struct pipe_framebuffer_state *pfb)
+{
+ assert(!batch->nondraw);
+
+ util_copy_framebuffer_state(&batch->framebuffer, pfb);
+}
+
/* NOTE: could drop the last ref to batch
*/
void
struct fd_batch *fd_batch_create(struct fd_context *ctx, bool nondraw);
+void fd_batch_set_fb(struct fd_batch *batch, const struct pipe_framebuffer_state *pfb) assert_dt;
+
void fd_batch_flush(struct fd_batch *batch) assert_dt;
bool fd_batch_has_dep(struct fd_batch *batch, struct fd_batch *dep) assert_dt;
void fd_batch_add_dep(struct fd_batch *batch, struct fd_batch *dep) assert_dt;
struct fd_batch *batch = batch_from_key(ctx, key);
fd_screen_unlock(ctx->screen);
+ fd_batch_set_fb(batch, pfb);
+
return batch;
}
if (unlikely(!batch)) {
batch =
fd_batch_from_fb(ctx, &ctx->framebuffer);
- util_copy_framebuffer_state(&batch->framebuffer, &ctx->framebuffer);
fd_batch_reference(&ctx->batch, batch);
fd_context_all_dirty(ctx);
}