Update buffer pool handling to use less memory

This commit is contained in:
Georg Hagen
2024-09-30 16:44:17 +02:00
parent b81cf48a44
commit f2a059a5c8
2 changed files with 4 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ namespace OpenVulkano::Vulkan
void Renderer::Tick()
{
if (!scene) [[unlikely]] return;
currentImageId = context.swapChain.AcquireNextImage();
scene->GetCamera()->SetSize(context.window->GetWidth(), context.window->GetHeight());
scene->GetCamera()->SetContentScaleFactor(context.window->GetContentScale());

View File

@@ -48,6 +48,9 @@ namespace OpenVulkano::Vulkan
[[nodiscard]] void* GetMappedMemory() const { return mapped; }
template <typename T = char>
[[nodiscard]] T* GetMappedMemory() const { return static_cast<T*>(mapped); }
/**
* \brief Maps the buffer into the memory of the host.
* \tparam T The type of the buffers data.