Restructure some files regarding resource management
This commit is contained in:
22
openVulkanoCpp/Vulkan/Resources/MemoryAllocation.cpp
Normal file
22
openVulkanoCpp/Vulkan/Resources/MemoryAllocation.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "ManagedBuffer.hpp"
|
||||
#include "Base/Logger.hpp"
|
||||
|
||||
namespace OpenVulkano::Vulkan
|
||||
{
|
||||
void MemoryAllocation::HandleChildMappingValidation() const
|
||||
{
|
||||
if (IsChildMapped())
|
||||
{
|
||||
Logger::RENDER->error("A single memory allocation should only be mapped once! Mapping a single allocation multiple times might not work or might not work reliable with all driver implementations.");
|
||||
#ifdef CRASH_ON_MULTIPLE_MAPPINGS_TO_SAME_ALLOCATION
|
||||
throw std::runtime_error("A single memory allocation should only be mapped once!");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user