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

Method LoadTextureFromMemoryDeferred

src/engine/TextureCache.cpp:636–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634}
635
636std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromMemoryDeferred(
637 const std::shared_ptr<vfs::IBlob>& data,
638 const std::string& name,
639 const std::string& mimeType,
640 bool sRGB)
641{
642 std::shared_ptr<TextureData> texture = CreateTextureData();
643
644 texture->forceSRGB = sRGB;
645 texture->path = name;
646 texture->mimeType = mimeType;
647
648 if (FillTextureData(data, texture, "", mimeType))
649 {
650 TextureLoaded(texture);
651
652 std::lock_guard<std::mutex> guard(m_TexturesToFinalizeMutex);
653
654 m_TexturesToFinalize.push(texture);
655 }
656
657 ++m_TexturesLoaded;
658
659 return texture;
660}
661
662
663std::shared_ptr<TextureData> TextureCache::GetLoadedTexture(std::filesystem::path const& path)

Callers 1

LoadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected