Download

FPostProcessPassParameters::Bind() Link error

Hello, everybody. I have a problem and I don’t know why. when I use ‘PostprocessParameter’, I will get a link error, **but I have already added “Renderer” to the dependency module list **in xxx.build.cs.

Here are the details of the error:


unresolved external symbol "public: void __cdecl FPostProcessPassParameters::Bind(class FShaderParameterMap const &)" (?Bind@FPostProcessPassParameters@@QEAAXAEBVFShaderParameterMap@@@Z) referenced in function "public: static class FShader * __cdecl FPostProcessSunMaskPS_ES2::ConstructCompiledInstance(struct FShader::CompiledShaderInitializerType const &)" (?ConstructCompiledInstance@FPostProcessSunMaskPS_ES2@@SAPEAVFShader@@AEBUCompiledShaderInitializerType@2@@Z)
1>E:	estUE4_MyTest\MyLightShaft\Binaries\Win64\UE4Editor-MyLightShaft.dll : fatal error LNK1120: 1 unresolved externals

Here is the source code:


#include "FPPPParameters.h"
#include "Modules/ModuleManager.h"

#include "Classes/Engine/TextureRenderTarget2D.h"
#include "Classes/Engine/World.h"
#include "Runtime/Renderer/Private/RendererModule.h"
#include "Runtime/Renderer/Private/PostProcess/RenderingCompositionGraph.h"
#include "SceneRenderTargetParameters.h"
#include "GlobalShader.h"
#include "PipelineStateCache.h"
#include "RHIStaticStates.h"
#include "SceneUtils.h"
#include "SceneInterface.h"
#include "ShaderParameterUtils.h"
#include "Logging/MessageLog.h"
#include "Internationalization/Internationalization.h"

IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, FPPPParameters, "FPPPParameters" );


class FPostProcessSunMaskVS_ES2 : public FGlobalShader
{
    DECLARE_SHADER_TYPE(FPostProcessSunMaskVS_ES2, Global);

    static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters& Parameters)
    {
        return !IsConsolePlatform(Parameters.Platform);
    }

    FPostProcessSunMaskVS_ES2() {}

public:
    FPostProcessPassParameters PostprocessParameter;

    FPostProcessSunMaskVS_ES2(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
        : FGlobalShader(Initializer)
    {
        PostprocessParameter.Bind(Initializer.ParameterMap);
    }

    void SetVS(const FRenderingCompositePassContext& Context)
    {
        const FVertexShaderRHIParamRef ShaderRHI = GetVertexShader();
        FGlobalShader::SetParameters<FViewUniformShaderParameters>(Context.RHICmdList, ShaderRHI, Context.View.ViewUniformBuffer);
        PostprocessParameter.SetVS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI());
    }

    virtual bool Serialize(FArchive& Ar) override
    {
        bool bShaderHasOutdatedParameters = FGlobalShader::Serialize(Ar);
        Ar << PostprocessParameter;
        return bShaderHasOutdatedParameters;
    }
};

IMPLEMENT_SHADER_TYPE(, FPostProcessSunMaskVS_ES2, TEXT("/Engine/Private/PostProcessMobile.usf"), TEXT("SunMaskVS_ES2"), SF_Vertex);

Any help would be appreciated!

Any help would be appreciated!

You should also include the relevant header file which is


#include "Runtime/Renderer/Public/PostProcessParameters.h"

I added the header file you said, but it seems doesn’t work~~~ Is there any module I have missed?

Can anyone help?

I asked an experienced colleague and finally got the answer: because of FPostProcessPassParameters:: Bind() hasn’t a module API.Like its other functions.
This is the official explanation:https://docs.unrealengine.com/en-US/…API/index.html