I tried to convert a glsl shader to hlsl.
The most things are working but in one line a get a very strange error:
HLSL pixel shader compilation failed:
(54): error X3511: loop does not appear to terminate in a timely manner (1024 iterations)
Code: Select all
[...]
while (NB.r < height) {<-----this is line 54
height -= step;
offsetCoord += delta;
NB = tex2D(heightMap, offsetCoord);
}
[...]
What I don't understand is: How should the compiler even know how many iterations will happen, because
step and delta are depending on what is set in the ShaderCallback (height is 1.0 at the beginning).
If I replace (NB.r < height) with (1.0 < 0.9) which is always false the error disappears, but of course
this would not be a acceptable solution (and the results are not right of course).
I hope anybody can help me.