text: // TODO Refactor Necessary!!!!!! (Plan overall engine architecture for GPU driven rendering)
  #pragma once
  #include "OdysseyVulkanCore/OdysseyVulkanCore/Handle/Handles.h"
  #include "OdysseyVulkanCore/OdysseyVulkanCore/Memory/VMABufferSupport.h"
  #include "OdysseyVulkanCore/OdysseyVulkanCore/Utility/Matrix.h"
  #include <vulkan/vulkan.h>
  
  namespace OdysseyVulkanCore::Model {
  
  class IndexedMesh {
   public:
    IndexedMesh(Handles::VMABufferHandle vertex_buffer, const uint32_t vertex_count,
                Handles::VMABufferHandle index_buffer, const uint32_t index_count, VkIndexType vk_index_type)
        : vma_vertex_buffer{std::move(vertex_buffer)},
          vk_vertex_buffer(vma_vertex_buffer.m_handle), vertex_count{vertex_count},
  
          vma_index_buffer{std::move(index_buffer)}, vk_index_buffer{vma_index_buffer.m_handle}, index_count{index_count},
          vk_index_type{vk_index_type} {
    }
  
    template <typename VertexType, typename IndexType>
    [[nodiscard]] static IndexedMesh create(VmaAllocator vma_allocator, const std::vector<VertexType>& vertices,
                                            const std::vector<IndexType>& indices,
                                            const Initialize::ImmediateSubmit& immediate_submit) {
      // Load mesh vertices into GPU accessible memory only:
      const auto vertex_count = static_cast<uint32_t>(vertices.size());
      Handles::VMABufferHandle vertex_buffer = Memory::Support::create_and_load_gpu_buffer<VertexType>(
          vma_allocator, vertices, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, immediate_submit);
  
      // Load mesh indices into GPU accessible memory only:
      const auto index_count = static_cast<uint32_t>(indices.size());
      Handles::VMABufferHandle index_buffer = Memory::Support::create_and_load_gpu_buffer<IndexType>(
          vma_allocator, indices, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, immediate_submit);
  
      // Set index type
      const VkIndexType index_type = calc_index_type<IndexType>();
      return IndexedMesh{std::move(vertex_buffer), vertex_count, std::move(index_buffer), index_count, index_type};
    }
  
    Handles::VMABufferHandle vma_vertex_buffer;
    VkBuffer vk_vertex_buffer;
    uint32_t vertex_count{0};
  
    Handles::VMABufferHandle vma_index_buffer;
    VkBuffer vk_index_buffer;
    uint32_t index_count{0};
  
    VkIndexType vk_index_type{};
    glm::mat4 model_matrix{1.0f};
  
   private:
    template <typename IndexType>
    [[nodiscard]] static VkIndexType calc_index_type() {
      if constexpr (std::is_same<IndexType, uint16_t>()) {
        return VK_INDEX_TYPE_UINT16;
      }
      if constexpr (std::is_same<IndexType, uint32_t>()) {
        return VK_INDEX_TYPE_UINT32;
      }
      ODYSSEY_ERROR("Unknown datatype to index type being converted (e.g. uint16_t to VK_INDEX_TYPE_UINT16")
      return VK_INDEX_TYPE_UINT32;
    }
  };
  
  }  // namespace OdysseyVulkanCore::Model
  