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

Method setTexture

Source/Falcor/Scene/Material/Material.cpp:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172 }
173
174 bool Material::setTexture(const TextureSlot slot, const ref<Texture>& pTexture)
175 {
176 if (!hasTextureSlot(slot))
177 {
178 logWarning("Material '{}' does not have texture slot '{}'. Ignoring call to setTexture().", getName(), to_string(slot));
179 return false;
180 }
181
182 if (pTexture == getTexture(slot)) return false;
183
184 FALCOR_ASSERT((size_t)slot < mTextureSlotInfo.size());
185 mTextureSlotData[(size_t)slot].pTexture = pTexture;
186
187 markUpdates(UpdateFlags::ResourcesChanged);
188 if (slot == TextureSlot::Emissive)
189 markUpdates(UpdateFlags::EmissiveChanged);
190
191 return true;
192 }
193
194 ref<Texture> Material::getTexture(const TextureSlot slot) const
195 {

Callers 2

bindShaderDataMethod · 0.45
assignTexturesMethod · 0.45

Calls 6

hasTextureSlotFunction · 0.85
getTextureFunction · 0.85
to_stringFunction · 0.70
logWarningFunction · 0.50
getNameFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected