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

Refactoring of command pool, command buffer, and staging buffer management #470

Closed IAmNotHanni closed 2 years 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);
});

Add new wrapper methods and refactor existing ones

Device wrapper

Bugs

Outlook