There's D3DPMISCCAPS_FOGVERTEXCLAMPED. I can't find any docs with a quick google search, but it sounds related.
That flag doesn't exist prior to d3d9. The tests differ on d3d8 too, and I haven't found a matching flag there. (If you think it's worth a look: What is the value of this flag for your AMD cards?)
By the way, I found this regarding clamping: http://msdn.microsoft.com/en-us/library/windows/hardware/ff539405%28v=vs.85%...
"Because the driver clamps the fog intensity value on a per-pixel basis, the runtime for DirectX 9.0 and later no longer clamps the fog intensity value before sending it to the driver."
This suggests that the clamping behavior should be different for d3d8 and d3d9. The D3DPMISCCAPS_FOGINFVF flag could probably be used to differentiate the behavior for d3d9, but again it does not exist on d3d8.
Gosh this is complicated. So much for a simple abs().
Definitely, so thanks for your help. The tests for abs() should now be sufficient [in theory -- e.g. I have no idea what to do about them crashing on your Radeon 9000].
Testing the oFog clamp behavior is a nice extra -- I wouldn't be unhappy if a version of the patch that leaves that out could be committed.
Best Joachim