<commit_before>#include <gbGraphics/MemoryBuffer.hpp>

#include <gbGraphics/CommandPoolRegistry.hpp>
#include <gbGraphics/GraphicsInstance.hpp>

#include <gbVk/CommandBuffer.hpp>
#include <gbVk/CommandBuffers.hpp>
#include <gbVk/Device.hpp>

#include <gbBase/Assert.hpp>

namespace GHULBUS_GRAPHICS_NAMESPACE
{
MemoryBuffer::MemoryBuffer(GraphicsInstance& instance, VkDeviceSize size,
                           VkBufferUsageFlags buffer_usage, MemoryUsage memory_usage)
    :m_buffer(instance.getVulkanDevice().createBuffer(size, buffer_usage)),
     m_deviceMemory(instance.getDeviceMemoryAllocator().allocateMemoryForBuffer(m_buffer, memory_usage)),
     m_instance(&instance), m_size(size), m_bufferUsage(buffer_usage), m_memoryUsage(memory_usage)
{
    m_buffer.bindBufferMemory(m_deviceMemory);
}

MemoryBuffer::MemoryBuffer(GraphicsInstance& instance, VkDeviceSize size,
                           VkBufferUsageFlags buffer_usage, VkMemoryPropertyFlags required_flags)
    :m_buffer(instance.getVulkanDevice().createBuffer(size, buffer_usage)),
     m_deviceMemory(instance.getDeviceMemoryAllocator().allocateMemoryForBuffer(m_buffer, required_flags)),
     m_instance(&instance), m_size(size), m_bufferUsage(buffer_usage), m_memoryUsage(MemoryUsage::CpuOnly)
{
    m_deviceMemory.bindBuffer(m_buffer);
}

MemoryBuffer::~MemoryBuffer()
{
    // make sure buffer is destroyed first, before the memory that backs it up
    GhulbusVulkan::Buffer destroyer(std::move(m_buffer));
}

//GhulbusVulkan::SubmitStaging setDataAsynchronously(std::byte const* data);<commit_msg>fixed wrong call in MemoryBuffer constructor<commit_after>#include <gbGraphics/MemoryBuffer.hpp>

#include <gbGraphics/CommandPoolRegistry.hpp>
#include <gbGraphics/GraphicsInstance.hpp>

#include <gbVk/CommandBuffer.hpp>
#include <gbVk/CommandBuffers.hpp>
#include <gbVk/Device.hpp>

#include <gbBase/Assert.hpp>

namespace GHULBUS_GRAPHICS_NAMESPACE
{
MemoryBuffer::MemoryBuffer(GraphicsInstance& instance, VkDeviceSize size,
                           VkBufferUsageFlags buffer_usage, MemoryUsage memory_usage)
    :m_buffer(instance.getVulkanDevice().createBuffer(size, buffer_usage)),
     m_deviceMemory(instance.getDeviceMemoryAllocator().allocateMemoryForBuffer(m_buffer, memory_usage)),
     m_instance(&instance), m_size(size), m_bufferUsage(buffer_usage), m_memoryUsage(memory_usage)
{
    m_buffer.bindBufferMemory(m_deviceMemory);
}

MemoryBuffer::MemoryBuffer(GraphicsInstance& instance, VkDeviceSize size,
                           VkBufferUsageFlags buffer_usage, VkMemoryPropertyFlags required_flags)
    :m_buffer(instance.getVulkanDevice().createBuffer(size, buffer_usage)),
     m_deviceMemory(instance.getDeviceMemoryAllocator().allocateMemoryForBuffer(m_buffer, required_flags)),
     m_instance(&instance), m_size(size), m_bufferUsage(buffer_usage), m_memoryUsage(MemoryUsage::CpuOnly)
{
    m_buffer.bindBufferMemory(m_deviceMemory);
}

MemoryBuffer::~MemoryBuffer()
{
    // make sure buffer is destroyed first, before the memory that backs it up
    GhulbusVulkan::Buffer destroyer(std::move(m_buffer));
}

//GhulbusVulkan::SubmitStaging setDataAsynchronously(std::byte const* data);
{'fraction_non_alphanumeric': 0.10304743952246309, 'fraction_numerical': 0.0, 'mean_word_length': 6.474178403755869, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '340513', 'n_tokens_mistral': 962, 'n_tokens_neox': 955, 'n_words': 144}