Unable to unroll loop...know a smart way to pass a texture into a distance function?

I think I know why my loop is not unrolling, I’m trying to pass the main texture into a function that creates a distance field, texture could be noise or anything, at the moment I’ve got audio converted into texture, could be anything though.

I’m not sure if it’s because I’m using cginc files and i’m not passing the correct type of information over, here’s how I have it set up in the cginc file:

float NoiseField(float3 pos, sampler2D texture1)
{
    float2 uv = worldToTex(pos);
    float height = heightFeild(uv, texture1);
    return height;
}

Is passing the sampler texture around a bad idea?

float heightField(float2 uv, sampler2D tex)
{
float band = pow(uv.x,2.0);
float amp = tex2D(tex, float2(band,0.25)).x;
return amp * Curve((uv.y - 0.5)*5.0)*1.5;
}

tex2Dlod! I needed to use tex2Dlod instead of tex2D, mental.