(a) In determining whether a legal action is subject to or should be dismissed under this chapter, the court shall consider the pleadings, evidence a court could consider under Rule 166a, Texas Rules of Civil Procedure, and supporting and opposing affidavits stating the facts on which the liability or defense is based.
(b) On a motion by a party or on the court's own motion and on a showing of good cause, the court may allow specified and limited discovery relevant to the motion.