summaryrefslogtreecommitdiffstats
path: root/AssetLoader/interface
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-11-05 00:30:51 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-11-05 00:30:51 +0000
commit150b73541c5f60dc291749deacb6ddec57cc25a2 (patch)
treed7356f3259d8e9b34013bd15029dfdc7d8db7ccb /AssetLoader/interface
parentImGuiDiligentRenderer: added MSL shaders (diff)
downloadDiligentTools-150b73541c5f60dc291749deacb6ddec57cc25a2.tar.gz
DiligentTools-150b73541c5f60dc291749deacb6ddec57cc25a2.zip
GLTFLoader: made texture cache thread-safe
Diffstat (limited to 'AssetLoader/interface')
-rw-r--r--AssetLoader/interface/GLTFLoader.hpp8
1 files changed, 7 insertions, 1 deletions
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 <memory>
#include <cfloat>
#include <unordered_map>
+#include <mutex>
#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<std::string, RefCntWeakPtr<ITexture>>;
+ struct TextureCacheType
+ {
+ std::mutex TexturesMtx;
+
+ std::unordered_map<std::string, RefCntWeakPtr<ITexture>> Textures;
+ };
Model(IRenderDevice* pDevice,
IDeviceContext* pContext,