mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
zink: track persistent resource objects, not resources
this is broken after the backing object split because resources themselves no longer have guaranteed lifetimes Fixes:616720d6ae("zink: track resource_object usage instead of resource usage") Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10270> (cherry picked from commitde31a510cc)
This commit is contained in:
parent
5b34892630
commit
a693bc1b99
2 changed files with 7 additions and 6 deletions
|
|
@ -427,7 +427,7 @@
|
|||
"description": "zink: track persistent resource objects, not resources",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "616720d6aec7db5c919bb3e79510b1c83fb99c47"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -490,13 +490,14 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
|
|||
vkResetFences(zink_screen(ctx->base.screen)->dev, 1, &batch->state->fence.fence);
|
||||
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
util_dynarray_foreach(&batch->state->persistent_resources, struct zink_resource*, res) {
|
||||
assert(!(*res)->obj->offset);
|
||||
while (util_dynarray_contains(&batch->state->persistent_resources, struct zink_resource_object*)) {
|
||||
struct zink_resource_object *obj = util_dynarray_pop(&batch->state->persistent_resources, struct zink_resource_object*);
|
||||
assert(!obj->offset);
|
||||
VkMappedMemoryRange range = {
|
||||
VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
|
||||
NULL,
|
||||
(*res)->obj->mem,
|
||||
(*res)->obj->offset,
|
||||
obj->mem,
|
||||
obj->offset,
|
||||
VK_WHOLE_SIZE,
|
||||
};
|
||||
vkFlushMappedMemoryRanges(screen->dev, 1, &range);
|
||||
|
|
@ -568,7 +569,7 @@ zink_batch_reference_resource_rw(struct zink_batch *batch, struct zink_resource
|
|||
}
|
||||
/* multiple array entries are fine */
|
||||
if (res->obj->persistent_maps)
|
||||
util_dynarray_append(&batch->state->persistent_resources, struct zink_resource*, res);
|
||||
util_dynarray_append(&batch->state->persistent_resources, struct zink_resource_object*, res->obj);
|
||||
|
||||
batch->has_work = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue