  We prove the weight part of Serre's conjecture in generic situations for
forms of $U(3)$ which are compact at infinity and split at places dividing $p$
as conjectured by Herzig. We also prove automorphy lifting theorems in
dimension three. The key input is an explicit description of tamely potentially
crystalline deformation rings with Hodge-Tate weights $(2,1,0)$ for
$K/\mathbb{Q}_p$ unramified combined with patching techniques. Our results show
that the (geometric) Breuil-M\'ezard conjectures hold for these deformation
rings.
