Recommended Posts

I have to report few bugs i have found in the Microsoft HLSL Shader Compiler 9.29.952.3111 (latest DX SDK, aug 2010)

I am trying to implement GPU-based shader that will preprocess height field for ConeStep mapping, the code is complex for pixel shader but is possible and fast. See the file attached.

BUGS:1. Lines 347. There is infinitive loop for ( ; true; )that will break out when the recusive job is done. The compiler use REP instruction that has max count of iterations 255. So the loop is not infinitive, the code is wrong.The alternative NVidia CGC compiler uses the LOOP instruction with the StepInc == 0, so the loop stays infinitive

3. The compilation time for O3 switch is ~40 minutes for Core2Quad 3GHZ (and results in message above). For example CGC compiler takes less than a second.

4. I tried to workaround the finitive loop by using 2 nested loops (uncomment line 345). This fails even in O1 optimization mode with message "error X4505: maximum temp register index exceeded". I do not understand why the second loop requires more registers. Also i cannot understand why the number of extra-required registers is GREATER than full number of registers used (factor > 2 because the shader uses 15 registers only) ?