# UE 5.7.4 — Use-after-free of FD3D12SamplerState in FD3D12DescriptorCache::BuildSamplerTable during Nanite BasePass

**URL:** <https://forums.unrealengine.com/t/ue-5-7-4-use-after-free-of-fd3d12samplerstate-in-fd3d12descriptorcache-buildsamplertable-during-nanite-basepass/2746946>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine, crash, Rendering, Nanite\
**Created:** [August 27, 2026, 8:02pm UTC](https://forums.unrealengine.com/t/ue-5-7-4-use-after-free-of-fd3d12samplerstate-in-fd3d12descriptorcache-buildsamplertable-during-nanite-basepass/2746946 "2026-08-27T20:02:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![lucasr94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lucasr94](https://forums.unrealengine.com/u/lucasr94)\
**Post date:** [September 4, 2026, 12:47pm UTC](https://forums.unrealengine.com/t/ue-5-7-4-use-after-free-of-fd3d12samplerstate-in-fd3d12descriptorcache-buildsamplertable-during-nanite-basepass/2746946/5 "2026-09-04T12:47:50Z")

</div>

Hi everyone, I found the solution to my problem. I had two different triggers causing the same crash: one was related to Nanite, and the other was caused by an invalid shader. Both were sharing information through a Material Parameter Collection.

Since I only have around five Material Parameter Collections in the entire project, I decided to keep them loaded at all time **(Basically, what I did was create an array of hard references to the five Material Parameter Collections in the Game Instance. So hopefully the solution I found can help others too, because I can see that a lot of people are having this problem.)**. One of the things happening in both cases was that they were trying to be used after they had already been released.

So I kept them permanently loaded, and that fixed the bug. I’ve had the game running for a full day now, and it hasn’t crashed or thrown any errors.

Lastly, one of the things I fixed that wasn’t directly causing the crash, but could have triggered other issues later, was that I had around 190 materials at runtime that weren’t compiling because they were losing references to Material Functions. Unreal was then interpreting them as more basic materials, I think, which left the project exposed to potential future errors.

I tracked down the missing references and updated them, which fixed the issue with the ~190 materials that weren’t compiling.

---

_[View the full topic](https://forums.unrealengine.com/t/ue-5-7-4-use-after-free-of-fd3d12samplerstate-in-fd3d12descriptorcache-buildsamplertable-during-nanite-basepass/2746946)._
