I’ve been playing with ARB_fragment_program, but I’ve had problems getting KIL to actually work.
For example, even this:
MOV temp, 1.0;
KIL temp;
appears to cause the fragment to be killed. The only thing that seems to not kill the fragment is KIL 1.0; (or KIL x for any non-negative x constant).
KIL kills if any component isn’t positive. Thus, you may be testing a variable which has some negative component.
Try declaring a param that initializes all four components to 1, and run a KIL on that, as an experiment. It could be a driver bug (make sure you use the freshest available drivers) but experimenting more makes for better bug reports.
If I understand correctly, that should be a No-Op, but as before it kills all fragments. Well, not exactly. The first frame it draws is drawn as though the fragment program weren’t running at all, but thereafter it discards all fragments. I’ll update my driver.
I did what I should have tried a while ago and find that KIL works just fine in Apple’s Shader Builder. That at leat gives me a baseline that it’s not a fundamental OS/driver/hardware issue. Now to see what’s going on…
The issue was that KIL pushed me over the texture indirection limit (since KIL is considered a texture instruction). It would be nice if the documentation mentioned this more explicity.
I am not sure, though, why this didn’t produce an error. I was using this to catch fragment program errors, which I found in documentation somewhere: