Most dolostones are early diagenetic to shallow burial replacements, not primary precipitates.
Here are four high-quality, freely available PDF papers on the origin of carbonate sedimentary rocks (covering formation processes, depositional models, diagenesis, and carbonate factories). I’ve given a brief one-line note for each so you can pick what's most relevant. origin of carbonate sedimentary rocks pdf new