More code cleanup

This commit is contained in:
2020-10-18 21:56:30 +02:00
parent d50a14f9c9
commit 0790e40294
9 changed files with 328 additions and 241 deletions

View 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 "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
}
}
}