UE Crashes when using compute shaders
I'm using compute shaders to deform a mesh. I'm having a consistent crash when running/compiling my code:
Usually this appears if I don't set my project's LoadingPhase to "PostConfigInit". However, I have already done this. The editor opens and I can run my project fine. Problem is when I make changes to my code and have to recompile. Directly compiling through the editor crashes after a while. Compiling through Visual Studio only works if I open the editor, make it crash on purpose, and reopen afterwards. Only then does it apply the changes made.
I'm not posting my code right now because its fairly long, and I figured there could be some basic stuff that I'm missing. If that's not the case, I'll try to supply at least a sample of the code that I think might be causing the problem.
asked Oct 21 '14 at 05:49 PM in Rendering
Okay this problem is because of hot reload. The module needs to be loaded prior to a specific point during startup, which does happen, but when a hot reload occurs after an in editor compile, the module is reloaded immediately, causing the engine to crash, this is correct behavior, in the sense that a module that needs to be loaded PostConfigInit to allow the shader type to be registered, which cannot happen during runtime of the editor, but maybe it shouldn't crash but warn the user and not reload the shader or something along those lines.
I was able to get around this crash by creating a secondary module (CrashTestEngine in this case) and moved the CS class into that module, set that module to PostConfigInit and the main module to Default. When you change something in the main module and recompile from editor, it will work fine. This means if you want to change something in the secondary module, you will need to exit the editor and recompile from VS.
answered Oct 28 '14 at 12:44 PM
Im just taking a stab here since the error is in regards to bInitializedSerialiationHistory. Do your compute shaders have bound parameters? ie you call Parameter.Bind in the constructor? If so, are you serializing those parameters? I've noticed not doing that can potentially cause crashes.
answered Oct 22 '14 at 05:08 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here