Missing global shader X's permutation 0, Please make sure cooking was successful.

Hi!

First of all - I’m a dummy and found why this wasn’t working… solution at end.

The setup of this plugin is as follows:

PostProcessing (plugin)

PostProcessing (module, base system)

PostProcessingEffects (module, individual effects that use the base system)

There are also editor modules, but they don’t play into this.

I already had some simple helper shaders in the base module, and they worked fine.

Then I added a more complicated effect with a custom shader to the effects module, and that worked fine locally. However, after submitting it to our CI and trying any of the cooked test builds it spits out, they all crashed with the aforementioned missing global shader error.

I then spent a good day experimenting around, trying to simplify the shader, moving files around, and in the end determined that everything works fine as long as the FGlobalShader and IMPLEMENT_GLOBAL_SHADER stuff is in the base module, and not in the effects module. Which weirded me out, because it’s ugly, but it was an OK workaround.

And then when I cleaned up my perforce changelists, I saw what the actual issue was…

I had failed to submit the updated .uplugin file to the CI, which changed the LoadingPhase for the PostProcessingEffects module from Default to PostConfigInit.

When starting the editor, Unreal checks that and errors out, making it obvious what the issue is. But the cooker apparently doesn’t do that, and instead just silently ignores the shader. The Test build definitely doesn’t check this and just crashes out with a missing global shader.

So in the end, a classical ‘forgot to submit updated file’ error was the issue. What would definitely have helped here would have been if the cooker would also error out and inform that there’s a global shader in a module that is being loaded too late, just like the editor does.

Thanks,

Ciao, Daniel!