mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-18 06:00:35 +02:00
asahi: Implement invalidate_resource
From Panfrost. This lets us avoid storing depth/stencil attachments at the end of the frame in GLES. On my 4K monitor, glmark2 -btexture at fullscreen goes from 705fps to 1150fps. I assume gains on real workloads will be smaller. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
This commit is contained in:
parent
28b652af80
commit
720ff76de4
1 changed files with 14 additions and 1 deletions
|
|
@ -1117,9 +1117,22 @@ agx_destroy_context(struct pipe_context *pctx)
|
|||
}
|
||||
|
||||
static void
|
||||
agx_invalidate_resource(struct pipe_context *ctx,
|
||||
agx_invalidate_resource(struct pipe_context *pctx,
|
||||
struct pipe_resource *resource)
|
||||
{
|
||||
struct agx_context *ctx = agx_context(pctx);
|
||||
struct agx_batch *batch = agx_get_batch(ctx);
|
||||
|
||||
/* Handle the glInvalidateFramebuffer case */
|
||||
if (batch->key.zsbuf && batch->key.zsbuf->texture == resource)
|
||||
batch->resolve &= ~PIPE_CLEAR_DEPTHSTENCIL;
|
||||
|
||||
for (unsigned i = 0; i < batch->key.nr_cbufs; ++i) {
|
||||
struct pipe_surface *surf = batch->key.cbufs[i];
|
||||
|
||||
if (surf && surf->texture == resource)
|
||||
batch->resolve &= ~(PIPE_CLEAR_COLOR0 << i);
|
||||
}
|
||||
}
|
||||
|
||||
static struct pipe_context *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue