Hi, I’m working on compute shader and try to pass a texture array to hlsl, what i’ve done is something like:
//shader parameters defined in Sub FGlobalShader class
SHADER_USE_PARAMETER_STRUCT(FMyStruct, FGlobalShader)
BEGIN_SHADER_PARAMETER_STRUCT(FParameters,)
SHADER_PARAMETER_ARRAY(FMatrix, Transforms, [10])
SHADER_PARAMETER_RDG_TEXTURE_ARRAY(Texture2D, Textures, [10])
SHADER_PARAMETER_SAMPLER(SamplerState, SceneTextureSampler)
END_SHADER_PARAMETER_STRUCT()
and in .usf:
Texture2D<float4> Textures[10];
float4x4 Transforms[10];
But it can’t complete the compile with an error shown:
permutation 0 has unbound parameters not represented in the parameter struct:
Textures[0]
Textures[1]
So i dive in to engine source and see how they use them, it shows like that:
Texture2D<float4> Textures_0;
Texture2D<float4> Textures_1;
I’ve tried and it works fine, so my question is why float4x4 Transforms[10];
is acceptable but for texture is not? and the syntax of Textures_0
is a little strange, any theories?
My engine version is 4.27.2, dx11.