MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / LoadTextureFromMemoryAsync

Method LoadTextureFromMemoryAsync

src/engine/TextureCache.cpp:580–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578 threadPool.AddTask([this, texture, path]()
579 {
580 auto fileData = ReadTextureFile(path);
581 if (fileData)
582 {
583 if (FillTextureData(fileData, texture, path.extension().generic_string(), ""))
584 {
585 TextureLoaded(texture);
586
587 std::lock_guard<std::mutex> guard(m_TexturesToFinalizeMutex);
588
589 m_TexturesToFinalize.push(texture);
590 }
591 }
592
593 ++m_TexturesLoaded;
594 });
595
596 return texture;
597}
598
599std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromMemoryAsync(
600 const std::shared_ptr<vfs::IBlob>& data,
601 const std::string& name,
602 const std::string& mimeType,
603 const TextureLoadOptions& options,
604 ThreadPool& threadPool)
605{
606 std::shared_ptr<TextureData> texture = CreateTextureData();
607
608 texture->loadOptions = options;
609 texture->path = name;
610 texture->mimeType = mimeType;
611

Callers 1

LoadMethod · 0.80

Calls 1

AddTaskMethod · 0.80

Tested by

no test coverage detected