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

Method removeMaterial

Source/Falcor/Scene/Material/MaterialSystem.cpp:253–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251 }
252
253 void MaterialSystem::removeMaterial(const MaterialID materialID)
254 {
255 FALCOR_CHECK(materialID.isValid() && materialID.get() < mMaterials.size(), "Material ID is invalid.");
256
257 // Mark descriptors used by the deleted material as reserved.
258 // This is a workaround until we have dynamically sized descriptor arrays and proper resource tracking.
259 const auto& material = mMaterials[materialID.get()];
260 mReservedTextureDescCount += material->getMaxTextureCount();
261 mReservedBufferDescCount += material->getMaxBufferCount();
262 mReservedTexture3DDescCount += material->getMaxTexture3DCount();
263
264 // Remove textures that were used by the material and loaded via the texture manager.
265 mpTextureManager->removeTextures(material.get());
266
267 // Remove the material.
268 mMaterials[materialID.get()] = nullptr;
269 mMaterialsChanged = true;
270 }
271
272 void MaterialSystem::replaceMaterial(const MaterialID materialID, const ref<Material>& pReplacement)
273 {

Callers

nothing calls this directly

Calls 5

getMaxBufferCountMethod · 0.80
removeTexturesMethod · 0.80
isValidMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected