# Bug when saving a material instance

**URL:** <https://forums.unrealengine.com/t/bug-when-saving-a-material-instance/420621>\
**Category:** Asset Creation\
**Tags:** unreal-engine, bug-report, question, CPP\
**Created:** [March 23, 2018, 3:39am UTC](https://forums.unrealengine.com/t/bug-when-saving-a-material-instance/420621 "2018-03-23T03:39:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![espaghetters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@espaghetters](https://forums.unrealengine.com/u/espaghetters)\
**Post date:** [March 23, 2018, 3:39am UTC](https://forums.unrealengine.com/t/bug-when-saving-a-material-instance/420621/1 "2018-03-23T03:39:06Z")

</div>

I’m getting the following bug when saving a material instance in Unreal.

LogOutputDevice: Error: Ensure condition failed: false [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Renderer\Private\ShaderBaseClasses.cpp] [Line: 224]  
TBasePassVSFPrecomputedVolumetricLightmapLightingPolicy shader uniform expression set mismatched shader map for material MaterialInstanceDynamic\_26/WorldGridMaterial, forcing expression cache evaluation.  
Material: Material /Engine/EngineMaterials/WorldGridMaterial.WorldGridMaterial  
Proxy: MaterialInstanceDynamic /Engine/Transient.MaterialInstanceDynamic\_26

Unsure what is causing this.

---

<div class="post-metadata">

**Author:** ![espaghetters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@espaghetters](https://forums.unrealengine.com/u/espaghetters)\
**Post date:** [March 23, 2018, 12:18pm UTC](https://forums.unrealengine.com/t/bug-when-saving-a-material-instance/420621/2 "2018-03-23T12:18:06Z")

</div>

I gave up and I’m no longer creating a material instance for this inside of the editor. Instead I’m just creating a dynamic material on the constructor for the actor blueprint.

---

<div class="post-metadata">

**Author:** ![F-BlockL](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/f-blockl/32/552009_2.png) [@F-BlockL](https://forums.unrealengine.com/u/F-BlockL)\
**Post date:** [August 26, 2024, 9:50pm UTC](https://forums.unrealengine.com/t/bug-when-saving-a-material-instance/420621/3 "2024-08-26T21:50:34Z")

</div>

I have a simillarly inexplicable issue where an Ensure for “UE-46061 - Workaround for a rare crash with an outdated cached shader map” triggers, though I again have no idea why it is outdated in the first place.

Disabling the Uniform Expression Cache with the CVar **`r.AllowCachedUniformExpressions=0`** at least works around the issue.
