Let's say $ I $ is the Libor index for our underlying swap and $ D $ is our discount curve.
If at time $ t $ we have a forecast of all the relevant future Libor fixings $ L_{I}(t, T_{i}, T_{i}+\tau) $ for our swap, where $ \tau $ is the accrual factor for our Libor index and $ T_{i} $ is the time of the $ i $th fixing for our swap, we just need to solve for the fixed swap rate $ s $ that equates the NPV of the fixed leg of our swap with the NPV of the floating leg.
The fixed leg NPV is given by
$ V_{fixed} = \sum_{i}{s \tau D(t, T_{i})} = s \sum_{i}^{n}{\tau D(t, T_{i})} = s * PV01 $
where $ D(t, T_{i}) $ is the time $ t $ discount factor on our discount curve for time $ T_{i} $.
Similarly, the floating leg NPV is given by
$ V_{float} = \sum_{j}{ L_{I}(t, T_{j}, T_{j} + \tau) \tau D(t, T_{j}) } $
For a par swap, we know that $ V_{fixed} + V_{float} = 0 $, therefore we can substitute in for $ V_{fixed} $ and divide by the fixed leg PV01 (sometimes called the level or annuity of the swap) to obtain
$ s = \frac{-V_{float}}{PV01} $
In reality, each individual period's $ \tau $ may be slightly different due to day count conventions, but it's fairly clear that the swap rate $ s $ is just a weighted average of the forward Libor rates $ L_{I} $ on the floating leg of the swap