Accessing the Texture2DArray from C++ to .usf file #4-25 #Textures #Rendering

Hi, I am currently using 4.25.4 version, and I am experimenting on Global Shaders.

I want to pass in the shader(usf file) an array of textures and then output them through the pixel shader. But I don’t know if I use the appropriate code for that. here is the code.
In the .cpp file I use a setParameters function so I can send the textures to the shader.

function::SetParameters(
FRHICommandListImmediate& RHICmdList,
TArray<FRHITexture2D*> InInputTexture)
{
SetTextureParameter(RHICmdList, RHICmdList.GetBoundPixelShader(), TextureArray,
InputTextureSampler, TStaticSamplerState<SF_Bilinear>::GetRHI(), InInputTexture[i], i);
}
where TextureArray and InputTextureSampler are layout fields(FShaderResourceParameter)

and in the Shader.usf file I declare a Texture2DArray TextureArray variable;

when I execute it, the TextureArray has only 1 resource, while it should take the number of the total textures where in my case is “2”. ( I output a debug message the number of resources of TextureArray and it has one instead if 2)

Can someone help me how to solve that please?

I also thought that maybe Texture2DArray is considered as a 1 texture sliced by many???

Please help