  In the quasi-two-dimensional (quasi-2D) copper- and iron-based
superconductors, the onset of superconductivity is accompanied by a prominent
peak in the magnetic spectrum at momenta close to the wave-vector of the nearby
antiferromagnetic state. Such a peak is well described in terms of a spin
resonance mode, i.e., a spin-1 exciton theoretically predicted for quasi-2D
superconductors with a sign-changing gap. The same theories, however, indicate
that such a resonance mode should be absent in a three-dimensional (3D) system
with a spherical Fermi surface. This raises the question of the fate of the
spin resonance mode in layered unconventional superconductors that are not
strongly anisotropic, such as certain heavy-fermion compounds and potentially
the newly discovered nickelate superconductor NdNiO$_2$. Here, we use the
random-phase-approximation to calculate the dynamical spin susceptibility of 3D
superconductors with a $d_{x^2-y^2}$-wave gap symmetry and corrugated
cylindrical-like Fermi surfaces. By varying the out-of-plane hopping anisotropy
$t_z/t$, we demonstrate that the appearance of a spin resonance mode is
determined by the topology of the hot lines -- i.e. lines on the Fermi surface
that are connected by the magnetic wave-vector. For an in-plane
antiferromagnetic wave-vector, the hot lines undergo a topological transition
from open lines to closed loops at a critical $t_z/t$ value. The closed hot
lines cross the nodal superconducting lines, making the spin resonance mode
overdamped and incoherent. In contrast, for an out-of-plane antiferromagnetic
wave-vector, the hot lines remain open and the spin resonance mode remains
sharp. We discuss the experimental implications of our results for the
out-of-plane dispersion of the spin resonance mode and, more generally, for
inelastic neutron scattering experiments on unconventional superconductors.
