I am trying to make a custom function. SAMPLE_TEXTURE2D macro can't call from HLSL file

Hello, I am completely new to shader world and by trial and error I come this far.

I am trying to make a custom function which is going to read positions data which are come with a created texture (5x5, total 25 pixel) from a script. And I am having this error which the SAMPLE_TEXTURE2D macro can’t use/call in the file type of HLSL.

Can I have any advice or answer?

The Unity version I am using now is 2022.3.7f1 HDRP


Not the answer but I got a work around with “float4 pos = DataTexture.Load(int3(l,r,0));” in custom function string (Not with the HLSL file). I don’t know should I keep the post open or close.