(D3D) Ifdefs for HAVE_CG (and miscellaneous)