Why texture lookup count increases with material function?

Hello,

When I use this material function

in this material

the texture lookup count is 2. If I just plug the same TextureSample in the material without the material function, it goes down to 1.

I read the HLSL and I read why this is so, and when the shader will be compiled it will count as 1 in the very end,
and I understand that it’s an estimated count but:

  • is it a bad practice outputting MaterialAttributes in material functions?
  • is there a better way to keep the lookup estimate consistent ?

Thanks in advance