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

Method LoadTextureFromFile

src/engine/TextureCache.cpp:486–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484}
485
486std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromFile(
487 const std::filesystem::path& path,
488 bool sRGB,
489 CommonRenderPasses* passes,
490 nvrhi::ICommandList* commandList)
491{
492 std::shared_ptr<TextureData> texture;
493
494 if (FindTextureInCache(path, texture))
495 return texture;
496
497 texture->forceSRGB = sRGB;
498 texture->path = path.generic_string();
499
500 auto fileData = ReadTextureFile(path);
501 if (fileData)
502 {
503 if (FillTextureData(fileData, texture, path.extension().generic_string(), ""))
504 {
505 TextureLoaded(texture);
506
507 FinalizeTexture(texture, passes, commandList);
508 }
509 }
510
511 ++m_TexturesLoaded;
512
513 return texture;
514}
515
516std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromFileDeferred(
517 const std::filesystem::path& path,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected