c/renderer: Don't wait for device idle every frame.

Do wait on device idle when destroying the swap chain.
Don't wait on device idle multiple times in resize.

Validation on NVIDA and AMD is happy when only keeping
the two idles when resizing and destroying the swapchain.
This commit is contained in:
Lubosz Sarnecki 2020-04-09 17:29:21 +02:00
parent e477452ac6
commit 916d7708c2
2 changed files with 2 additions and 2 deletions

View file

@ -165,7 +165,6 @@ comp_renderer_frame(struct comp_renderer *r,
renderer_set_swapchain_image(r, 0, left, left_layer);
renderer_set_swapchain_image(r, 1, right, right_layer);
renderer_render(r);
r->c->vk.vkDeviceWaitIdle(r->c->vk.device);
}
void
@ -805,7 +804,6 @@ renderer_resize(struct comp_renderer *r)
renderer_create_frame_buffers(r);
renderer_allocate_command_buffers(r);
renderer_build_command_buffers(r);
vk->vkDeviceWaitIdle(vk->device);
}
static void

View file

@ -303,6 +303,8 @@ comp_swapchain_image_cleanup(struct vk_bundle *vk,
uint32_t array_size,
struct comp_swapchain_image *image)
{
vk->vkDeviceWaitIdle(vk->device);
if (image->views != NULL) {
for (uint32_t i = 0; i < array_size; ++i) {
if (image->views[i] == VK_NULL_HANDLE) {