Ṣalāt al‑mayyit must be performed after giving ghusl, camphorating, and shrouding. If it is performed before or while performing these – albeit forgetfully or on account of not knowing the ruling – it is not sufficient. Ruling 585.* It is not necessary for someone who wants to perform ṣalāt al‑mayyit to have wuḍūʾ, ghusl, or tayammum, or for his body and clothes to be pure.
In fact, even if his clothes are usurped there is no problem, although it is better that he observe all the rules that apply to other prayers. One must refrain from doing anything that breaks the form of ṣalāt al‑mayyit, and based on obligatory precaution, one must abstain from talking, laughing, and turning their back to the qibla.