Hi!
We’ve added a custom shader to one of our plugins that apparently doesn’t get cooked. It works perfectly fine when in editor. When starting a cooked build it crashes with the following error:
00:56:00 [2025.04.22-17.27.32:227][ 0]LogOutputDevice: Error: Fatal error: [File:.\Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 4573] 00:56:00 [2025.04.22-17.27.32:227][ 0]LogOutputDevice: Error: Missing global shader FPL_JumpFloodPS's permutation 0, Please make sure cooking was successful.
This isn’t the first custom shader in this plugin, the others appear to be working fine. There are no cooking errors.
The plugin consists of multiple modules. The base module does this in its StartupModule function:
void FPL_PostProcessingModule::StartupModule() { const FString& BaseDir = IPluginManager::Get().FindPlugin(TEXT("PL_PostProcessing"))->GetBaseDir(); const FString& PluginShaderDir = FPaths::Combine(BaseDir, TEXT("Shaders")); AddShaderSourceDirectoryMapping(TEXT("/PL_PostProcessing/Shaders"), PluginShaderDir); }
The shader in question is declared like this, in one of the other modules:
`class FPL_JumpFloodPS : public FGlobalShader
{
public:
DECLARE_GLOBAL_SHADER(FPL_JumpFloodPS);
SHADER_USE_PARAMETER_STRUCT(FPL_JumpFloodPS, FGlobalShader);
BEGIN_SHADER_PARAMETER_STRUCT(FParameters, )
SHADER_PARAMETER_STRUCT(FScreenPassTextureViewportParameters, Viewport)
SHADER_PARAMETER_RDG_TEXTURE_SRV(Texture2D, InputTexture)
SHADER_PARAMETER_SAMPLER(SamplerState, InputSampler)
SHADER_PARAMETER(float, StepSize)
RENDER_TARGET_BINDING_SLOTS()
END_SHADER_PARAMETER_STRUCT()
};
IMPLEMENT_GLOBAL_SHADER(FPL_JumpFloodPS, “/PL_PostProcessing/Shaders/JumpFlood/JumpFlood.usf”, “JumpFloodPS”, SF_Pixel);`We don’t really have a lot to go on here, any help finding out if this shader is getting cooked, or why this shader isn’t getting cooked (or if it is getting cooked, what the errors could be)?
Ciao, Daniel!