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 passes->BlitTexture(commandList, blitParams);
485 }
486
487 commandList->setPermanentTextureState(texture->texture, nvrhi::ResourceStates::ShaderResource);
488 commandList->commitBarriers();
489
490 ++m_TexturesFinalized;
491}
492
493void TextureCache::TextureLoaded(std::shared_ptr<TextureData> texture)
494{
495 std::lock_guard<std::mutex> guard(m_TexturesToFinalizeMutex);
496
497 if (texture->mimeType.empty())
498 log::message(m_InfoLogSeverity, "Loaded %d x %d, %d bpp: %s", texture->width, texture->height,
499 texture->originalBitsPerPixel, texture->path.c_str());
500 else
501 log::message(m_InfoLogSeverity, "Loaded %d x %d, %d bpp: %s (%s)", texture->width, texture->height,
502 texture->originalBitsPerPixel, texture->path.c_str(), texture->mimeType.c_str());
503}
504
505std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromFile(
506 const std::filesystem::path& path,
507 const TextureLoadOptions& options,
508 CommonRenderPasses* passes,
509 nvrhi::ICommandList* commandList)
510{
511 std::shared_ptr<TextureData> texture;
512
513 if (FindTextureInCache(path, options, texture))
514 return texture;
515
516 texture->loadOptions = options;
517 texture->path = path.generic_string();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected