nvk: clean up bo mappings

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Karol Herbst 2022-08-29 15:59:44 +02:00 committed by Marge Bot
parent 05bc4500ad
commit 71c830278f
4 changed files with 8 additions and 2 deletions

View file

@ -26,6 +26,7 @@ nvk_cmd_buffer_upload_reset(struct nvk_cmd_buffer_upload *upload)
{
list_for_each_entry_safe(struct nvk_cmd_buffer_upload, child,
&upload->list, list) {
nouveau_ws_bo_unmap(child->upload_bo, child->map);
nouveau_ws_bo_destroy(child->upload_bo);
free(child);
}

View file

@ -258,8 +258,10 @@ nvk_destroy_descriptor_pool(struct nvk_device *device, const VkAllocationCallbac
nvk_descriptor_set_destroy(device, pool, pool->entries[i].set, false);
}
if (pool->bo)
if (pool->bo) {
nouveau_ws_bo_unmap(pool->bo, pool->mapped_ptr);
nouveau_ws_bo_destroy(pool->bo);
}
vk_object_base_finish(&pool->base);
vk_free2(&device->vk.alloc, pAllocator, pool);

View file

@ -60,8 +60,10 @@ void
nvk_descriptor_table_finish(struct nvk_device *device,
struct nvk_descriptor_table *table)
{
if (table->bo != NULL)
if (table->bo != NULL) {
nouveau_ws_bo_unmap(table->bo, table->map);
nouveau_ws_bo_destroy(table->bo);
}
vk_free(&device->vk.alloc, table->free_table);
simple_mtx_destroy(&table->mutex);
}

View file

@ -689,6 +689,7 @@ nvk_shader_upload(struct nvk_device *dev, struct nvk_shader *shader)
assert(hdr_size <= sizeof(shader->hdr));
memcpy(ptr, shader->hdr, hdr_size);
memcpy(ptr + hdr_size, shader->code_ptr, shader->code_size);
nouveau_ws_bo_unmap(shader->bo, ptr);
#ifndef NDEBUG
if (debug_get_bool_option("NV50_PROG_DEBUG", false))