diff --git a/Nuake/Source/Nuake/Core/Logger.cpp b/Nuake/Source/Nuake/Core/Logger.cpp index 9ad8e688..63279eab 100644 --- a/Nuake/Source/Nuake/Core/Logger.cpp +++ b/Nuake/Source/Nuake/Core/Logger.cpp @@ -67,7 +67,7 @@ namespace Nuake m_Logs.push_back(newLog); } - std::vector Logger::GetLogs() + std::vector& Logger::GetLogs() { return m_Logs; } diff --git a/Nuake/Source/Nuake/Core/Logger.h b/Nuake/Source/Nuake/Core/Logger.h index 89260e08..588c3b74 100644 --- a/Nuake/Source/Nuake/Core/Logger.h +++ b/Nuake/Source/Nuake/Core/Logger.h @@ -29,7 +29,7 @@ namespace Nuake public: static void Log(const std::string& log, const std::string& logger = "main", LOG_TYPE type = VERBOSE); - static std::vector GetLogs(); + static std::vector& GetLogs(); static void ClearLogs(); static size_t GetLogCount() { return m_Logs.size(); } }; diff --git a/Nuake/Source/Nuake/Rendering/Vulkan/VulkanImage/VulkanImage.cpp b/Nuake/Source/Nuake/Rendering/Vulkan/VulkanImage/VulkanImage.cpp index 29931a8c..4a6706a4 100644 --- a/Nuake/Source/Nuake/Rendering/Vulkan/VulkanImage/VulkanImage.cpp +++ b/Nuake/Source/Nuake/Rendering/Vulkan/VulkanImage/VulkanImage.cpp @@ -241,8 +241,8 @@ VulkanImage::VulkanImage(void* inData, ImageFormat inFormat, Vector2 inSize) : V ); AddGPUCleanUpFunc([=]() { - //vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr); - //vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation); + vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr); + vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation); }); } @@ -318,14 +318,14 @@ VulkanImage::VulkanImage(void* inData, size_t inSize) : }); AddGPUCleanUpFunc([=]() { - //vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr); - //vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation); + vkDestroyImageView(VkRenderer::Get().GetDevice(), ImageView, nullptr); + vmaDestroyImage(VulkanAllocator::Get().GetAllocator(), Image, Allocation); }); } VulkanImage::~VulkanImage() { - //Logger::Log("Deleting VulkanImage", "vulkan", VERBOSE); + Logger::Log("Deleting VulkanImage", "vulkan", VERBOSE); GPUResources::Get().QueueDeletion(GetGPUCleanUpStack()); } diff --git a/Nuake/Source/Nuake/Rendering/Vulkan/VulkanRenderer.cpp b/Nuake/Source/Nuake/Rendering/Vulkan/VulkanRenderer.cpp index 2a23bda3..0147771e 100644 --- a/Nuake/Source/Nuake/Rendering/Vulkan/VulkanRenderer.cpp +++ b/Nuake/Source/Nuake/Rendering/Vulkan/VulkanRenderer.cpp @@ -36,7 +36,7 @@ #include #include -bool NKUseValidationLayer = true; +bool NKUseValidationLayer = false; using namespace Nuake; diff --git a/Nuake/Source/Nuake/Scene/Components/LightComponent.cpp b/Nuake/Source/Nuake/Scene/Components/LightComponent.cpp index 39cd350a..a91817ea 100644 --- a/Nuake/Source/Nuake/Scene/Components/LightComponent.cpp +++ b/Nuake/Source/Nuake/Scene/Components/LightComponent.cpp @@ -23,6 +23,17 @@ namespace Nuake } } + LightComponent::~LightComponent() + { + for (int i = 0; i < CSM_AMOUNT; i++) + { + if (m_ShadowMaps[i]) + { + GPUResources::Get().RemoveTexture(m_ShadowMaps[i]); + } + } + } + void LightComponent::SetCastShadows(bool toggle) { CastShadows = toggle; diff --git a/Nuake/Source/Nuake/Scene/Components/LightComponent.h b/Nuake/Source/Nuake/Scene/Components/LightComponent.h index c258aa92..4efd1bed 100644 --- a/Nuake/Source/Nuake/Scene/Components/LightComponent.h +++ b/Nuake/Source/Nuake/Scene/Components/LightComponent.h @@ -46,6 +46,7 @@ namespace Nuake BindComponentField<&LightComponent::CastShadows>("CastShadows", "CastShadows"); } + public: // All lights int32_t Type = Point; @@ -72,7 +73,7 @@ namespace Nuake public: LightComponent(); - ~LightComponent() = default; + ~LightComponent(); std::vector LightMapIDs = std::vector(); void SetCastShadows(bool toggle);