| 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 | { |
no test coverage detected