From 150b73541c5f60dc291749deacb6ddec57cc25a2 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 4 Nov 2020 16:30:51 -0800 Subject: GLTFLoader: made texture cache thread-safe --- AssetLoader/interface/GLTFLoader.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'AssetLoader/interface') diff --git a/AssetLoader/interface/GLTFLoader.hpp b/AssetLoader/interface/GLTFLoader.hpp index e3e9ed0..0a9275b 100644 --- a/AssetLoader/interface/GLTFLoader.hpp +++ b/AssetLoader/interface/GLTFLoader.hpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "../../../DiligentCore/Graphics/GraphicsEngine/interface/RenderDevice.h" #include "../../../DiligentCore/Graphics/GraphicsEngine/interface/DeviceContext.h" @@ -277,7 +278,12 @@ struct Model float3 max = float3{-FLT_MAX, -FLT_MAX, -FLT_MAX}; } dimensions; - using TextureCacheType = std::unordered_map>; + struct TextureCacheType + { + std::mutex TexturesMtx; + + std::unordered_map> Textures; + }; Model(IRenderDevice* pDevice, IDeviceContext* pContext, -- cgit v1.2.3