inexorgame / vulkan-renderer

A new 3D game engine for Linux and Windows using C++20 and Vulkan API 1.3, in very early but ongoing development
https://inexor.org
MIT License
777 stars 34 forks source link

Refactor management of command pools, command buffers, staging buffers, and remove once command buffer #472

Closed IAmNotHanni closed 1 year ago

IAmNotHanni commented 2 years ago

Summary

Closes https://github.com/inexorgame/vulkan-renderer/issues/465 Closes https://github.com/inexorgame/vulkan-renderer/issues/459

Removed features (part of refactoring)

New features

m_device.execute(m_name, [&](const CommandBufferHandle &cmd_buf) {
    cmd_buf
        .change_image_layout(m_texture_image->get(), VK_IMAGE_LAYOUT_UNDEFINED,
                             VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)
        .copy_buffer_to_image(texture_data, static_cast<VkDeviceSize>(texture_size), m_texture_image->get(),
                              copy_region, m_name)
        .change_image_layout(m_texture_image->get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
                             VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
});

Use wrapper methods instead of raw Vulkan functions everywhere in the code base

Add new wrapper methods and refactor existing ones

Device wrapper

CommandBufferHandle wrapper

Bugs

Outlook

IAmNotHanni commented 2 years ago
IAmNotHanni commented 1 year ago

I made the pull request much smaller again, only focussing on the core refactoring. Otherwise it would have been just too much small stuff to review. I want to make a cleanup pull request after this, which can deal with the small issues step by step.

IAmNotHanni commented 1 year ago

Thank you for your great review @yeetari ! I'm waiting for further comments :smile:

IceflowRE commented 1 year ago
IAmNotHanni commented 1 year ago
IAmNotHanni commented 1 year ago
IAmNotHanni commented 1 year ago

Thank you guys for this amazing collaboration once again!