[SM5] Error X4532 with POM Material

Well I am actually on ~4.9 and I do not have access to an exact 4.8.1 build yet but this works fine for me here.

Here is the entire custom node text to paste in case there was an error:


float CurrRayHeight = 1.0;
float2 CurrOffset = float2( 0, 0 );
float2 LastOffset = float2( 0, 0 );

float LastSampledHeight = 1;
float CurrSampledHeight = 1;

int CurrSample = 0;

while ( CurrSample < (int) InNumSamples )
{
CurrSampledHeight = dot(InChannelMask, Tex.SampleGrad(TexSampler,InTexCoord+CurrOffset,InDX,InDY));
	
	if ( CurrSampledHeight > CurrRayHeight )
	{
		float Delta1 = CurrSampledHeight - CurrRayHeight;
		float Delta2 = ( CurrRayHeight + InStepSize ) - LastSampledHeight;

		float Ratio = Delta1/( Delta1 + Delta2 );

		CurrOffset = ( Ratio ) * LastOffset + ( 1.0 - Ratio ) * CurrOffset;

		CurrSample = InNumSamples + 1;
	}
	else
	{
		CurrSample++;

		CurrRayHeight -= InStepSize;

		LastOffset = CurrOffset;
		CurrOffset += InStepSize * InMaxOffset;

		LastSampledHeight = CurrSampledHeight;
	}
}

return CurrOffset;