Announcement

Collapse
No announcement yet.

FPostProcessPassParameters::Bind() Link error

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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:
    Code:
    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:\testUE4_MyTest\MyLightShaft\Binaries\Win64\UE4Editor-MyLightShaft.dll : fatal error LNK1120: 1 unresolved externals
    Here is the source code:
    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!
    Last edited by Young2Unreal; 06-10-2019, 04:50 AM.

    #2
    Any help would be appreciated!

    Comment


      #3
      You should also include the relevant header file which is

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

      Comment


        #4
        Originally posted by Balgy View Post
        You should also include the relevant header file which is

        Code:
        #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?
        Last edited by Young2Unreal; 06-13-2019, 09:59 PM.

        Comment


          #5
          Can anyone help?

          Comment


            #6
            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

            The easiest way to think about these specifiers is that they are used to tag functions, classes or data as public to your module's DLL file. If you mark a function in the Engine module as ENGINE_API, then any module that imports Engine can access that function directly.
            Last edited by Young2Unreal; 06-17-2019, 08:19 AM.

            Comment

            Working...
            X