Are you sure it is dFdx(p)
which returns 0 and not dFdx(uv)
/ dFdy(uv)
? We already had a problem with dFdx(uv)
/ dFdy(uv)
, see Anisotropy Issues - Worse on Mac OS - #9 by Evgeni_Popov.
The fix would be to explicitely provide tangents instead of trying to compute them with the cotangent frame.
However, your fix may well be ok, to avoid crashing the shader.