mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
zink: refcount miptails
according to spec, the miptail should only be uncommited if there are no remaining commited regions Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10139 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29152>
This commit is contained in:
parent
3a728bed23
commit
5c8a7e3ca5
2 changed files with 11 additions and 4 deletions
|
|
@ -1073,7 +1073,9 @@ zink_bo_commit(struct zink_context *ctx, struct zink_resource *res, unsigned lev
|
|||
if (level >= res->sparse.imageMipTailFirstLod) {
|
||||
uint32_t offset = res->sparse.imageMipTailOffset;
|
||||
cur_sem = texture_commit_miptail(screen, res, backing[i]->bo, backing_start[i], offset, commit, cur_sem);
|
||||
if (!cur_sem)
|
||||
if (cur_sem)
|
||||
res->obj->miptail_commits++;
|
||||
else
|
||||
ok = false;
|
||||
goto out;
|
||||
} else {
|
||||
|
|
@ -1121,9 +1123,13 @@ zink_bo_commit(struct zink_context *ctx, struct zink_resource *res, unsigned lev
|
|||
}
|
||||
if (level >= res->sparse.imageMipTailFirstLod) {
|
||||
uint32_t offset = res->sparse.imageMipTailOffset;
|
||||
cur_sem = texture_commit_miptail(screen, res, NULL, 0, offset, commit, cur_sem);
|
||||
if (!cur_sem)
|
||||
ok = false;
|
||||
assert(res->obj->miptail_commits);
|
||||
res->obj->miptail_commits--;
|
||||
if (!res->obj->miptail_commits) {
|
||||
cur_sem = texture_commit_miptail(screen, res, NULL, 0, offset, commit, cur_sem);
|
||||
if (!cur_sem)
|
||||
ok = false;
|
||||
}
|
||||
goto out;
|
||||
} else {
|
||||
commits_pending = true;
|
||||
|
|
|
|||
|
|
@ -1279,6 +1279,7 @@ struct zink_resource_object {
|
|||
// }
|
||||
|
||||
|
||||
unsigned miptail_commits;
|
||||
VkDeviceSize offset, size, alignment;
|
||||
uint64_t vkflags;
|
||||
uint64_t vkusage;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue