4.5 - Unresolved external Symbol FRHICommandSetShaderTexture

Hi There,

Seems I am unable to compile my FluidSurface plugin with UE4 v4.5. The following line is the culprit:

SetTextureParameter(
	RHICmdList,
	Shader->GetDomainShader( ),
	FluidTextureParameter,
	FluidTextureSamplerParameter,
	TStaticSamplerState< SF_AnisotropicLinear, AM_Clamp, AM_Clamp, AM_Clamp >::GetRHI( ),
	FluidTextureResource
	);

If I replace Shader->GetDomainShader( ) with Vertex or Pixel shader it works fine, but does not work with Domain, Hull or Geometry shader, I get the following errors:

1>Module.FluidSurfaceEngine.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FRHICommandSetShaderTexture<class TRefCountPtr<class FRHIDomainShader> >::Execute(void)" (__imp_?Execute@?$FRHICommandSetShaderTexture@V?$TRefCountPtr@VFRHIDomainShader@@@@@@QEAAXXZ) referenced in function "public: static void __cdecl FRHICommand<struct FRHICommandSetShaderTexture<class TRefCountPtr<class FRHIDomainShader> > >::ExecuteAndDestruct(struct FRHICommandBase *)" (?ExecuteAndDestruct@?$FRHICommand@U?$FRHICommandSetShaderTexture@V?$TRefCountPtr@VFRHIDomainShader@@@@@@@@SAXPEAUFRHICommandBase@@@Z)

1>Module.FluidSurfaceEngine.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FRHICommandSetShaderSampler<class TRefCountPtr<class FRHIDomainShader> >::Execute(void)" (__imp_?Execute@?$FRHICommandSetShaderSampler@V?$TRefCountPtr@VFRHIDomainShader@@@@@@QEAAXXZ) referenced in function "public: static void __cdecl FRHICommand<struct FRHICommandSetShaderSampler<class TRefCountPtr<class FRHIDomainShader> > >::ExecuteAndDestruct(struct FRHICommandBase *)" (?ExecuteAndDestruct@?$FRHICommand@U?$FRHICommandSetShaderSampler@V?$TRefCountPtr@VFRHIDomainShader@@@@@@@@SAXPEAUFRHICommandBase@@@Z)

This was originally working fine in v4.4 and below. I noticed that RHICommandListCommandExecutes.inl is new in v4.5 and that seems to be where the error is coming from, but I don’t see any reason for it.

Any assistance will be greatly appreciated. I will continue to investigate at my end, but at this time I have hit a brick wall.

Okay I have solved this. Not sure if this is intended though. I noticed that GetDomainShader, GetHullShader, and GetGeometryShader all return FShaderRHIRef& where as GetVertexShader and GetPixelShader return FShaderRHIParamRef which is where I was running into the issue. I fixed this by casting the above return value to FDomainShaderRHIParamRef

Does this mean you’re working on a 4.5 port for your plugin right now? I’m trying to get it running in 4.5 now and ran into the same issue which is how I arrived here.

Apologies, did not see this comment until now. I have compiled and released a version for 4.5 if you were not already aware.