Files
OpenVulkano/openVulkanoCpp/Vulkan/Resources/ManagedResource.cpp
2020-10-28 01:13:11 +01:00

23 lines
754 B
C++

/*
* 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 "ManagedResource.hpp"
#include "Base/Logger.hpp"
namespace openVulkanoCpp::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
}
}
}