UE5 gpu crashed or d3d device removed

hey folks, i had this crash happening to me until a moment ago. the issue was a corrupted post processing shader. It took foerever to debug it and I’m not certain I’m fully stable yet, but I found a material that would crash my editor whenever I tried to open it. I removed it from my post processing chain and the crash stopped happening at runtime. I’ve deleted the shader and re-written it (since I can’t recompile it) and all seems well. I will report back if the error comes back.

TLDR: if you switched from DX11 to DX12 for an existent project, it’s possible some materials were corrupted in the process. I’m actually not 100% this is what happened, but switching to dx12 coincided with the crash and corrupted shader, so it’s pretty safe bet I think. i am on 5.1.1 btw.

i hope this helps someone down the line.

Edit: I don’t think it’s actually a corrupted file. If I revert to DX11, I can open all my post process mats again. Through some trial and error, I was able to identify stencil test as the culprit. Still not sure why though, especially since another material with the exact same settings and configuration does not crash the editor when I open it. Note: does not occur if the bad post process materials are handled before tonemapping with the same settings otherwise.