const union pipe_color_union *color, double depth, unsigned stencil)
{
struct lima_context *ctx = lima_context(pctx);
+ struct lima_submit *submit = lima_submit_get(ctx);
- lima_flush(ctx);
+ /* flush if this submit already contains any draw, otherwise multi clear can be
+ * combined into a single submit */
+ if (lima_submit_has_draw_pending(submit)) {
+ lima_do_submit(submit);
+ submit = lima_submit_get(ctx);
+ }
lima_update_submit_wb(ctx, buffers);
surf->reload = false;
}
- struct lima_submit *submit = lima_submit_get(ctx);
struct lima_submit_clear *clear = &submit->clear;
clear->buffers = buffers;
struct lima_dump *dump;
};
+static inline bool
+lima_submit_has_draw_pending(struct lima_submit *submit)
+{
+ return !!submit->plbu_cmd_array.size;
+}
+
struct lima_submit *lima_submit_get(struct lima_context *ctx);
bool lima_submit_add_bo(struct lima_submit *submit, int pipe,
void *lima_submit_create_stream_bo(struct lima_submit *submit, int pipe,
unsigned size, uint32_t *va);
+void lima_do_submit(struct lima_submit *submit);
+
bool lima_submit_init(struct lima_context *ctx);
void lima_submit_fini(struct lima_context *ctx);