mirror of https://github.com/xemu-project/xemu.git
nv2a/vk: Don't release textures until after draw completes
This commit is contained in:
parent
33db2787f7
commit
e20a2b15b3
|
@ -1312,6 +1312,8 @@ void pgraph_vk_finish(PGRAPHState *pg, FinishReason finish_reason)
|
||||||
r->command_buffer_fence));
|
r->command_buffer_fence));
|
||||||
r->submit_count += 1;
|
r->submit_count += 1;
|
||||||
|
|
||||||
|
bool check_budget = false;
|
||||||
|
|
||||||
// Periodically check memory budget
|
// Periodically check memory budget
|
||||||
const int max_num_submits_before_budget_update = 5;
|
const int max_num_submits_before_budget_update = 5;
|
||||||
if (finish_reason == VK_FINISH_REASON_FLIP_STALL ||
|
if (finish_reason == VK_FINISH_REASON_FLIP_STALL ||
|
||||||
|
@ -1321,8 +1323,7 @@ void pgraph_vk_finish(PGRAPHState *pg, FinishReason finish_reason)
|
||||||
// VMA queries budget via vmaSetCurrentFrameIndex
|
// VMA queries budget via vmaSetCurrentFrameIndex
|
||||||
vmaSetCurrentFrameIndex(r->allocator, r->submit_count);
|
vmaSetCurrentFrameIndex(r->allocator, r->submit_count);
|
||||||
r->allocator_last_submit_index = r->submit_count;
|
r->allocator_last_submit_index = r->submit_count;
|
||||||
|
check_budget = true;
|
||||||
pgraph_vk_check_memory_budget(pg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VK_CHECK(vkWaitForFences(r->device, 1, &r->command_buffer_fence,
|
VK_CHECK(vkWaitForFences(r->device, 1, &r->command_buffer_fence,
|
||||||
|
@ -1331,6 +1332,10 @@ void pgraph_vk_finish(PGRAPHState *pg, FinishReason finish_reason)
|
||||||
r->descriptor_set_index = 0;
|
r->descriptor_set_index = 0;
|
||||||
r->in_command_buffer = false;
|
r->in_command_buffer = false;
|
||||||
destroy_framebuffers(pg);
|
destroy_framebuffers(pg);
|
||||||
|
|
||||||
|
if (check_budget) {
|
||||||
|
pgraph_vk_check_memory_budget(pg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NV2AState *d = container_of(pg, NV2AState, pgraph);
|
NV2AState *d = container_of(pg, NV2AState, pgraph);
|
||||||
|
|
|
@ -757,7 +757,6 @@ static void create_surface_image(PGRAPHState *pg, SurfaceBinding *surface)
|
||||||
|
|
||||||
VmaAllocationCreateInfo alloc_create_info = {
|
VmaAllocationCreateInfo alloc_create_info = {
|
||||||
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE,
|
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE,
|
||||||
.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VK_CHECK(vmaCreateImage(r->allocator, &image_create_info,
|
VK_CHECK(vmaCreateImage(r->allocator, &image_create_info,
|
||||||
|
|
Loading…
Reference in New Issue