From 43e5805e503321b5d33d3eecd3ee6c245b40e74c Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 6 Jul 2021 11:13:43 +0200 Subject: [PATCH] Tweaks --- Source/Engine/Content/Content.cpp | 26 +++++++------------ .../Engine/Platform/Win32/Win32Platform.cpp | 8 +----- .../Engine/Renderer/AtmospherePreCompute.cpp | 6 ++--- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/Source/Engine/Content/Content.cpp b/Source/Engine/Content/Content.cpp index 0b3f9a1d7..419ee23a6 100644 --- a/Source/Engine/Content/Content.cpp +++ b/Source/Engine/Content/Content.cpp @@ -986,25 +986,17 @@ Asset* Content::load(const Guid& id, const ScriptingTypeHandle& type, AssetInfo& #endif // Register asset - { - AssetsLocker.Lock(); - + ASSERT(result->GetID() == id); + AssetsLocker.Lock(); #if ASSETS_LOADING_EXTRA_VERIFICATION - - // Asset id has to be unique - if (Assets.ContainsKey(id)) - { - CRASH; - } - -#endif - - // Add to the list - ASSERT(result->GetID() == id); - Assets.Add(id, result); - - AssetsLocker.Unlock(); + // Asset id has to be unique + if (Assets.ContainsKey(id)) + { + CRASH; } +#endif + Assets.Add(id, result); + AssetsLocker.Unlock(); // Start asset loading result->startLoading(); diff --git a/Source/Engine/Platform/Win32/Win32Platform.cpp b/Source/Engine/Platform/Win32/Win32Platform.cpp index 6099451bf..38564cceb 100644 --- a/Source/Engine/Platform/Win32/Win32Platform.cpp +++ b/Source/Engine/Platform/Win32/Win32Platform.cpp @@ -150,16 +150,10 @@ bool Win32Platform::Init() CpuInfo.L1CacheSize = processorL1CacheSize; CpuInfo.L2CacheSize = processorL2CacheSize; CpuInfo.L3CacheSize = processorL3CacheSize; - - // Get page size SYSTEM_INFO siSysInfo; GetSystemInfo(&siSysInfo); CpuInfo.PageSize = siSysInfo.dwPageSize; - - // Get clock speed - CpuInfo.ClockSpeed = GetClockFrequency(); - - // Get cache line size + CpuInfo.ClockSpeed = ClockFrequency; { int args[4]; __cpuid(args, 0x80000006); diff --git a/Source/Engine/Renderer/AtmospherePreCompute.cpp b/Source/Engine/Renderer/AtmospherePreCompute.cpp index d0083bfc6..9dcad4cf8 100644 --- a/Source/Engine/Renderer/AtmospherePreCompute.cpp +++ b/Source/Engine/Renderer/AtmospherePreCompute.cpp @@ -348,11 +348,9 @@ void AtmospherePreComputeService::Update() // Init service if (!_shader) - { _shader = Content::LoadAsyncInternal(TEXT("Shaders/AtmospherePreCompute")); - if (_shader && !_shader->IsLoaded()) - return; - } + if (_shader && !_shader->IsLoaded()) + return; if (init()) { LOG(Fatal, "Cannot setup Atmosphere Pre Compute!");