mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
freedreno: Fix resource tracking vs rebind/invalidate
We can now no longer rely on certain dirty bits to re-trigger draw time resource tracking. We need to use the new fd_dirty*_resource() APIs. Fixes `org.skia.skqp.SkQPRunner#gles_recordopts` on android 9. Fixes:0a62a874fc("freedreno: Re-work dirty-resource tracking") Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22683> (cherry picked from commitd437e389e0)
This commit is contained in:
parent
ef41157341
commit
b44e6d297f
3 changed files with 19 additions and 9 deletions
|
|
@ -670,7 +670,7 @@
|
|||
"description": "freedreno: Fix resource tracking vs rebind/invalidate",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "0a62a874fc5b7387fb4e1da9183fb2c5a9d4b700"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ rebind_resource_in_ctx(struct fd_context *ctx,
|
|||
for (unsigned i = 0; i < vb->count && !(ctx->dirty & FD_DIRTY_VTXBUF);
|
||||
i++) {
|
||||
if (vb->vb[i].buffer.resource == prsc)
|
||||
fd_context_dirty(ctx, FD_DIRTY_VTXBUF);
|
||||
fd_dirty_resource(ctx, prsc, FD_DIRTY_VTXBUF, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ rebind_resource_in_ctx(struct fd_context *ctx,
|
|||
i < so->num_targets && !(ctx->dirty & FD_DIRTY_STREAMOUT);
|
||||
i++) {
|
||||
if (so->targets[i]->buffer == prsc)
|
||||
fd_context_dirty(ctx, FD_DIRTY_STREAMOUT);
|
||||
fd_dirty_resource(ctx, prsc, FD_DIRTY_STREAMOUT, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +114,8 @@ rebind_resource_in_ctx(struct fd_context *ctx,
|
|||
const unsigned num_ubos = util_last_bit(cb->enabled_mask);
|
||||
for (unsigned i = 1; i < num_ubos; i++) {
|
||||
if (cb->cb[i].buffer == prsc) {
|
||||
fd_context_dirty_shader(ctx, stage, FD_DIRTY_SHADER_CONST);
|
||||
fd_dirty_shader_resource(ctx, prsc, stage,
|
||||
FD_DIRTY_SHADER_CONST, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -126,7 +127,8 @@ rebind_resource_in_ctx(struct fd_context *ctx,
|
|||
struct fd_texture_stateobj *tex = &ctx->tex[stage];
|
||||
for (unsigned i = 0; i < tex->num_textures; i++) {
|
||||
if (tex->textures[i] && (tex->textures[i]->texture == prsc)) {
|
||||
fd_context_dirty_shader(ctx, stage, FD_DIRTY_SHADER_TEX);
|
||||
fd_dirty_shader_resource(ctx, prsc, stage,
|
||||
FD_DIRTY_SHADER_TEX, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -139,7 +141,9 @@ rebind_resource_in_ctx(struct fd_context *ctx,
|
|||
const unsigned num_images = util_last_bit(si->enabled_mask);
|
||||
for (unsigned i = 0; i < num_images; i++) {
|
||||
if (si->si[i].resource == prsc) {
|
||||
fd_context_dirty_shader(ctx, stage, FD_DIRTY_SHADER_IMAGE);
|
||||
bool write = si->si[i].access & PIPE_IMAGE_ACCESS_WRITE;
|
||||
fd_dirty_shader_resource(ctx, prsc, stage,
|
||||
FD_DIRTY_SHADER_IMAGE, write);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -152,7 +156,9 @@ rebind_resource_in_ctx(struct fd_context *ctx,
|
|||
const unsigned num_ssbos = util_last_bit(sb->enabled_mask);
|
||||
for (unsigned i = 0; i < num_ssbos; i++) {
|
||||
if (sb->sb[i].buffer == prsc) {
|
||||
fd_context_dirty_shader(ctx, stage, FD_DIRTY_SHADER_SSBO);
|
||||
bool write = sb->writable_mask & BIT(i);
|
||||
fd_dirty_shader_resource(ctx, prsc, stage,
|
||||
FD_DIRTY_SHADER_SSBO, write);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1559,13 +1565,13 @@ fd_invalidate_resource(struct pipe_context *pctx,
|
|||
|
||||
if (pfb->zsbuf && pfb->zsbuf->texture == prsc) {
|
||||
batch->resolve &= ~(FD_BUFFER_DEPTH | FD_BUFFER_STENCIL);
|
||||
fd_context_dirty(ctx, FD_DIRTY_ZSA);
|
||||
fd_dirty_resource(ctx, prsc, FD_DIRTY_ZSA, true);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < pfb->nr_cbufs; i++) {
|
||||
if (pfb->cbufs[i] && pfb->cbufs[i]->texture == prsc) {
|
||||
batch->resolve &= ~(PIPE_CLEAR_COLOR0 << i);
|
||||
fd_context_dirty(ctx, FD_DIRTY_FRAMEBUFFER);
|
||||
fd_dirty_resource(ctx, prsc, FD_DIRTY_FRAMEBUFFER, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -410,6 +410,8 @@ fd_dirty_resource(struct fd_context *ctx, struct pipe_resource *prsc,
|
|||
BITMASK_ENUM(fd_dirty_3d_state) dirty, bool write)
|
||||
assert_dt
|
||||
{
|
||||
fd_context_dirty(ctx, dirty);
|
||||
|
||||
if (ctx->dirty_resource & dirty)
|
||||
return;
|
||||
|
||||
|
|
@ -426,6 +428,8 @@ fd_dirty_shader_resource(struct fd_context *ctx, struct pipe_resource *prsc,
|
|||
bool write)
|
||||
assert_dt
|
||||
{
|
||||
fd_context_dirty_shader(ctx, shader, dirty);
|
||||
|
||||
if (ctx->dirty_shader_resource[shader] & dirty)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue