MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / removeTextures

Method removeTextures

Source/Falcor/Utils/Image/TextureManager.cpp:508–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508void TextureManager::removeTextures(const Object* object)
509{
510 FALCOR_CHECK(object != nullptr, "Missing object.");
511
512 waitForAllTexturesLoading();
513
514 std::lock_guard<std::mutex> lock(mMutex);
515
516 // Remove object from ownership of all its associated textures.
517 // All textures that are left without any owners will be removed below.
518 std::vector<CpuTextureHandle> handles;
519 {
520 auto obj = mObjectToHandles.find(object);
521 if (obj == mObjectToHandles.end())
522 return;
523 for (auto handle : obj->second)
524 {
525 auto it = mHandleToObjects.find(handle);
526 FALCOR_ASSERT(it != mHandleToObjects.end());
527 it->second.erase(object);
528 if (it->second.empty())
529 handles.push_back(handle);
530 }
531 mObjectToHandles.erase(obj);
532 }
533
534 // Remove all textures that are now unowned.
535 for (const auto& handle : handles)
536 removeTextureInternal(handle);
537
538 if (!handles.empty())
539 logInfo("Texture manager: Removed {} textures.", handles.size());
540}
541
542TextureManager::TextureDesc TextureManager::getTextureDesc(const CpuTextureHandle& handle) const
543{

Callers 1

removeMaterialMethod · 0.80

Calls 6

logInfoFunction · 0.85
eraseMethod · 0.80
endMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected