Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UE5.3 FSR2 compilation issue for XSX platform #130

Open
yurabroy opened this issue May 2, 2024 · 0 comments
Open

UE5.3 FSR2 compilation issue for XSX platform #130

yurabroy opened this issue May 2, 2024 · 0 comments

Comments

@yurabroy
Copy link

yurabroy commented May 2, 2024

After few changes for XSX platform, getting next linking errors:
Can anyone help with this?

Module.FSR2TemporalUpscaling.cpp.obj : error LNK2019: unresolved external symbol ffxFsr2GetScratchMemorySizeDX12 referenced in function "public: virtual struct UE::Renderer::Private::ITemporalUpscaler::FOutputs __cdecl FFSR2TemporalUpscaler::AddPasses(class FRDGBuilder &,class FSceneView const &,struct UE::Renderer::Private::ITemporalUpscaler::FInputs const &)const " (?AddPasses@FFSR2TemporalUpscaler@@UEBA?AUFOutputs@ITemporalUpscaler@Private@Renderer@UE@@AEAVFRDGBuilder@@AEBVFSceneView@@AEBUFInputs@3456@@Z)
Module.FSR2TemporalUpscaling.cpp.obj : error LNK2019: unresolved external symbol ffxFsr2GetInterfaceDX12 referenced in function "public: virtual struct UE::Renderer::Private::ITemporalUpscaler::FOutputs __cdecl FFSR2TemporalUpscaler::AddPasses(class FRDGBuilder &,class FSceneView const &,struct UE::Renderer::Private::ITemporalUpscaler::FInputs const &)const " (?AddPasses@FFSR2TemporalUpscaler@@UEBA?AUFOutputs@ITemporalUpscaler@Private@Renderer@UE@@AEAVFRDGBuilder@@AEBVFSceneView@@AEBUFInputs@3456@@Z)
Module.FSR2TemporalUpscaling.cpp.obj : error LNK2019: unresolved external symbol ffxGetDeviceDX12 referenced in function "public: virtual struct UE::Renderer::Private::ITemporalUpscaler::FOutputs __cdecl FFSR2TemporalUpscaler::AddPasses(class FRDGBuilder &,class FSceneView const &,struct UE::Renderer::Private::ITemporalUpscaler::FInputs const &)const " (?AddPasses@FFSR2TemporalUpscaler@@UEBA?AUFOutputs@ITemporalUpscaler@Private@Renderer@UE@@AEAVFRDGBuilder@@AEBVFSceneView@@AEBUFInputs@3456@@Z)
Module.FSR2TemporalUpscaling.cpp.obj : error LNK2019: unresolved external symbol ffxGetCommandListDX12 referenced in function "public: __cdecl `public: virtual struct UE::Renderer::Private::ITemporalUpscaler::FOutputs __cdecl FFSR2TemporalUpscaler::AddPasses(class FRDGBuilder &,class FSceneView const &,struct Renderer::Private::ITemporalUpscaler::FOutputs::FInputs const &)const '[::K]::<lambda_1>::operator()(class FRHICommandListImmediate &)const " (??R<lambda_1>@?IK@??AddPasses@FFSR2TemporalUpscaler@@UEBA?AUFOutputs@ITemporalUpscaler@Private@Renderer@UE@@AEAVFRDGBuilder@@AEBVFSceneView@@AEBUFInputs@4567@@Z@QEBA@AEAVFRHICommandListImmediate@@@Z)
Module.FSR2TemporalUpscaling.cpp.obj : error LNK2019: unresolved external symbol ffxGetResourceDX12 referenced in function "public: __cdecl `public: virtual struct UE::Renderer::Private::ITemporalUpscaler::FOutputs __cdecl FFSR2TemporalUpscaler::AddPasses(class FRDGBuilder &,class FSceneView const &,struct Renderer::Private::ITemporalUpscaler::FOutputs::FInputs const &)const '[::K]::<lambda_1>::operator()(class FRHICommandListImmediate &)const " (??R<lambda_1>@?IK@??AddPasses@FFSR2TemporalUpscaler@@UEBA?AUFOutputs@ITemporalUpscaler@Private@Renderer@UE@@AEAVFRDGBuilder@@AEBVFSceneView@@AEBUFInputs@4567@@Z@QEBA@AEAVFRHICommandListImmediate@@@Z)

Changes of FSR2TemporalUpscaling.Build.cs:

public class FSR2TemporalUpscaling : ModuleRules
{
	public FSR2TemporalUpscaling(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicIncludePaths.AddRange(
			new string[] {
				// ... add public include paths required here ...
				EngineDirectory + "/Source/Runtime/Renderer/Private",
			}
		);

		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Engine",
				// ... add other public dependencies that you statically link with here ...
			}
		);


		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"Engine",
				"Projects",
				"RenderCore",
				"Renderer",
				"RHI",
				"Landscape",
				"CoreUObject",
				"EngineSettings",
				"DeveloperSettings",
				"FFXFSR2Api"
				// ... add private dependencies that you statically link with here ...	
			}
        );

		if (Target.Platform.IsInGroup(UnrealPlatformGroup.Microsoft))
		{
			PrivateDefinitions.Add("FSR2_SUPPORT_HALF=1");
		}
		else
		{
			PrivateDefinitions.Add("FSR2_SUPPORT_HALF=0");
		}

		if (Target.Platform.IsInGroup(UnrealPlatformGroup.Microsoft))
		{
			PrivateDependencyModuleNames.AddRange(
				new string[]
				{
					"FSR2TemporalUpscalingD3D12",
					"FFXFSR2D3D12"
				}
			);

			PrivateDefinitions.Add("FSR2_ENABLE_D3D12=1");
		}
		else
		{
			PrivateDefinitions.Add("FSR2_ENABLE_D3D12=0");
		}

		bool bEnableVulkan = false;
		if (Target.Platform.IsInGroup(UnrealPlatformGroup.Windows)
			|| Target.Platform.IsInGroup(UnrealPlatformGroup.Android))
		{
			AddEngineThirdPartyPrivateStaticDependencies(Target, "Vulkan");
			bEnableVulkan = true;
		}
		else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
		{
			if (Target.IsInPlatformGroup(UnrealPlatformGroup.Linux))
			{
				PrivateDependencyModuleNames.Add("ApplicationCore");
				AddEngineThirdPartyPrivateStaticDependencies(Target, "SDL2");

				string VulkanSDKPath = Environment.GetEnvironmentVariable("VULKAN_SDK");
				bool bSDKInstalled = !String.IsNullOrEmpty(VulkanSDKPath);
				if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Linux || !bSDKInstalled)
				{
					AddEngineThirdPartyPrivateStaticDependencies(Target, "Vulkan");
				}
				else
				{
					PrivateIncludePaths.Add(VulkanSDKPath + "/include");
					PrivateIncludePaths.Add(VulkanSDKPath + "/include/vulkan");
					PublicAdditionalLibraries.Add(Path.Combine(VulkanSDKPath, "lib", "libvulkan.so"));
				}
			}
			else
			{
				AddEngineThirdPartyPrivateStaticDependencies(Target, "VkHeadersExternal");
			}
			bEnableVulkan = true;
		}

		if (bEnableVulkan)
		{
			PrivateDependencyModuleNames.AddRange(
				new string[]
				{
					"VulkanRHI",
					"FSR2TemporalUpscalingVulkan",
					"FFXFSR2Vulkan"
				}
			);
			PrivateDefinitions.Add("FSR2_ENABLE_VK=1");
		}
		else
		{
			PrivateDefinitions.Add("FSR2_ENABLE_VK=0");
		}

		PrecompileForTargets = PrecompileTargetsType.Any;
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant