diff options
author | Lightning_A <aaronjrecord@gmail.com> | 2021-08-09 14:13:42 -0600 |
---|---|---|
committer | Lightning_A <aaronjrecord@gmail.com> | 2021-09-30 15:09:12 -0600 |
commit | c63b18507d21b8a213c073bced9057b571cdcd7a (patch) | |
tree | 96b8f7532ae5d923b75bfbac8d6763015b6646bb /drivers/vulkan | |
parent | e4dfa69bcf58e4d50acdde32c590364e43fce3ab (diff) |
Use range iterators for `Map`
Diffstat (limited to 'drivers/vulkan')
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 6 | ||||
-rw-r--r-- | drivers/vulkan/vulkan_context.cpp | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 086d3b4284..8743135f89 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -8688,10 +8688,10 @@ void RenderingDeviceVulkan::_free_pending_resources(int p_frame) { while (frames[p_frame].framebuffers_to_dispose_of.front()) { Framebuffer *framebuffer = &frames[p_frame].framebuffers_to_dispose_of.front()->get(); - for (Map<Framebuffer::VersionKey, Framebuffer::Version>::Element *E = framebuffer->framebuffers.front(); E; E = E->next()) { + for (const KeyValue<Framebuffer::VersionKey, Framebuffer::Version> &E : framebuffer->framebuffers) { //first framebuffer, then render pass because it depends on it - vkDestroyFramebuffer(device, E->get().framebuffer, nullptr); - vkDestroyRenderPass(device, E->get().render_pass, nullptr); + vkDestroyFramebuffer(device, E.value.framebuffer, nullptr); + vkDestroyRenderPass(device, E.value.render_pass, nullptr); } frames[p_frame].framebuffers_to_dispose_of.pop_front(); diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 1c7e83af21..152efc7807 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1755,8 +1755,8 @@ Error VulkanContext::prepare_buffers() { vkWaitForFences(device, 1, &fences[frame_index], VK_TRUE, UINT64_MAX); vkResetFences(device, 1, &fences[frame_index]); - for (Map<int, Window>::Element *E = windows.front(); E; E = E->next()) { - Window *w = &E->get(); + for (KeyValue<int, Window> &E : windows) { + Window *w = &E.value; w->semaphore_acquired = false; @@ -1837,8 +1837,8 @@ Error VulkanContext::swap_buffers() { VkSemaphore *semaphores_to_acquire = (VkSemaphore *)alloca(windows.size() * sizeof(VkSemaphore)); uint32_t semaphores_to_acquire_count = 0; - for (Map<int, Window>::Element *E = windows.front(); E; E = E->next()) { - Window *w = &E->get(); + for (KeyValue<int, Window> &E : windows) { + Window *w = &E.value; if (w->semaphore_acquired) { semaphores_to_acquire[semaphores_to_acquire_count++] = w->image_acquired_semaphores[frame_index]; @@ -1876,8 +1876,8 @@ Error VulkanContext::swap_buffers() { VkCommandBuffer *cmdbufptr = (VkCommandBuffer *)alloca(sizeof(VkCommandBuffer *) * windows.size()); submit_info.pCommandBuffers = cmdbufptr; - for (Map<int, Window>::Element *E = windows.front(); E; E = E->next()) { - Window *w = &E->get(); + for (KeyValue<int, Window> &E : windows) { + Window *w = &E.value; if (w->swapchain == VK_NULL_HANDLE) { continue; @@ -1911,8 +1911,8 @@ Error VulkanContext::swap_buffers() { present.pSwapchains = pSwapchains; present.pImageIndices = pImageIndices; - for (Map<int, Window>::Element *E = windows.front(); E; E = E->next()) { - Window *w = &E->get(); + for (KeyValue<int, Window> &E : windows) { + Window *w = &E.value; if (w->swapchain == VK_NULL_HANDLE) { continue; |