Usage of GetVertexShader() in UE 4.26

Hi all,

Sorry about this noob question. I am trying to port this patch of UE given in this PR of CARLA:

The patch has been made for UE 4.24 and I am trying to build it on latest 4.26 (for CARLA).

I am getting these build errors:

/home/sxv1kor/Downloads/GitHub/UnrealEngine_4.26/Engine/Source/Runtime/Engine/Private/CubemapUnwrapUtils.cpp:298:32: error: use of undeclared identifier ‘GetVertexShader’; did you mean ‘FRHIVertexShader’?
SetShaderValue(RHICmdList, GetVertexShader(), Transform, TransformValue);
^
/home/sxv1kor/Downloads/GitHub/UnrealEngine_4.26/Engine/Source/Runtime/RHI/Public/RHIResources.h:490:7: note: ‘FRHIVertexShader’ declared here
class FRHIVertexShader : public FRHIGraphicsShader
^
/home/sxv1kor/Downloads/GitHub/UnrealEngine_4.26/Engine/Source/Runtime/Engine/Private/CubemapUnwrapUtils.cpp:313:37: error: use of undeclared identifier ‘GetPixelShader’; did you mean ‘FRHIPixelShader’?
SetTextureParameter(RHICmdList, GetPixelShader(),CubeTexture,CubeTextureSampler,Texture);
^
/home/sxv1kor/Download

I believe the interfaces have changed since the versions, but I am unable to understand the new interfaces. Any hints would be helpful. Thanks in advance.

Hi all,

I could solve it with the following changes:

Solved it.
Use RHICmdList.GetBoundVertexShader() instead GetVertexShader() and
RHICmdList.GetBoundPixelShader() instead of GetPixelShader()

Dont use the macros GETSAFERHISHADER_VERTEX and GETSAFERHISHADER_PIXEL

GraphicsPSOInit.BoundShaderState.VertexShaderRHI = VertexShader.GetVertexShader();
GraphicsPSOInit.BoundShaderState.PixelShaderRHI = PixelShader.GetPixelShader();