{
struct lima_context *ctx = lima_context(pctx);
+ struct hash_entry *entry = _mesa_hash_table_search(ctx->write_submits, prsc);
+ if (!entry)
+ return;
+
+ struct lima_submit *submit = entry->data;
if (ctx->framebuffer.base.zsbuf && (ctx->framebuffer.base.zsbuf->texture == prsc))
- ctx->resolve &= ~(PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL);
+ submit->resolve &= ~(PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL);
if (ctx->framebuffer.base.nr_cbufs &&
(ctx->framebuffer.base.cbufs[0]->texture == prsc))
- ctx->resolve &= ~PIPE_CLEAR_COLOR0;
+ submit->resolve &= ~PIPE_CLEAR_COLOR0;
}
static void
/* add to submit when the buffer is dirty and resolve is clear (not added before) */
if (fb->base.nr_cbufs && (buffers & PIPE_CLEAR_COLOR0) &&
- !(ctx->resolve & PIPE_CLEAR_COLOR0)) {
+ !(submit->resolve & PIPE_CLEAR_COLOR0)) {
struct lima_resource *res = lima_resource(fb->base.cbufs[0]->texture);
lima_flush_submit_accessing_bo(ctx, res->bo, true);
_mesa_hash_table_insert(ctx->write_submits, &res->base, submit);
/* add to submit when the buffer is dirty and resolve is clear (not added before) */
if (fb->base.zsbuf && (buffers & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) &&
- !(ctx->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL))) {
+ !(submit->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL))) {
struct lima_resource *res = lima_resource(fb->base.zsbuf->texture);
lima_flush_submit_accessing_bo(ctx, res->bo, true);
_mesa_hash_table_insert(ctx->write_submits, &res->base, submit);
lima_submit_add_bo(submit, LIMA_PIPE_PP, res->bo, LIMA_SUBMIT_BO_WRITE);
}
- ctx->resolve |= buffers;
+ submit->resolve |= buffers;
}
static void
_mesa_hash_table_remove_key(ctx->submits, &submit->key);
- if (submit->key.cbuf && (ctx->resolve & PIPE_CLEAR_COLOR0))
+ if (submit->key.cbuf && (submit->resolve & PIPE_CLEAR_COLOR0))
_mesa_hash_table_remove_key(ctx->write_submits, submit->key.cbuf->texture);
- if (submit->key.zsbuf && (ctx->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)))
+ if (submit->key.zsbuf && (submit->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)))
_mesa_hash_table_remove_key(ctx->write_submits, submit->key.zsbuf->texture);
pipe_surface_reference(&submit->key.cbuf, NULL);
{
struct lima_context *ctx = submit->ctx;
- if (!(ctx->framebuffer.base.nr_cbufs && (ctx->resolve & PIPE_CLEAR_COLOR0)))
+ if (!(ctx->framebuffer.base.nr_cbufs && (submit->resolve & PIPE_CLEAR_COLOR0)))
return NULL;
struct lima_surface *surf = lima_surface(ctx->framebuffer.base.cbufs[0]);
struct lima_context *ctx = submit->ctx;
/* Depth buffer is always discarded */
- if (!(ctx->framebuffer.base.nr_cbufs && (ctx->resolve & PIPE_CLEAR_COLOR0)))
+ if (!(ctx->framebuffer.base.nr_cbufs && (submit->resolve & PIPE_CLEAR_COLOR0)))
return false;
struct lima_surface *surf = lima_surface(ctx->framebuffer.base.cbufs[0]);
frame->blocking = (fb->shift_min << 28) | (fb->shift_h << 16) | fb->shift_w;
frame->foureight = 0x8888;
- if (fb->base.nr_cbufs && (ctx->resolve & PIPE_CLEAR_COLOR0))
+ if (fb->base.nr_cbufs && (submit->resolve & PIPE_CLEAR_COLOR0))
lima_pack_wb_cbuf_reg(submit, wb_reg, wb_idx++);
if (fb->base.zsbuf &&
- (ctx->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)))
+ (submit->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)))
lima_pack_wb_zsbuf_reg(submit, wb_reg, wb_idx++);
}
ctx->plb_index = (ctx->plb_index + 1) % lima_ctx_num_plb;
- if (ctx->framebuffer.base.nr_cbufs && (ctx->resolve & PIPE_CLEAR_COLOR0)) {
+ if (ctx->framebuffer.base.nr_cbufs && (submit->resolve & PIPE_CLEAR_COLOR0)) {
/* Set reload flag for next draw. It'll be unset if buffer is cleared */
struct lima_surface *surf = lima_surface(ctx->framebuffer.base.cbufs[0]);
surf->reload = true;
ctx->submit = NULL;
lima_submit_free(submit);
-
- /* lima_submit_free still need this */
- ctx->resolve = 0;
}
void