SetConstantBuffers() was previously setting the dirty flag unconditionally, even when the states aren't actually dirty, which likely caused PreDraw() to do lots of unnecessary work.
However, it still needs to set the flag if the offset to the buffer changes or if the number of constants change. If the buffer itself changes, UpdateBinding() will set the dirty flag.
I've tested the change on an RTX 3070 with a map in CS:GO, and the FPS increased by about around 35%.
SetConstantBuffers() was previously setting the dirty flag unconditionally, even when the states aren't actually dirty, which likely caused PreDraw() to do lots of unnecessary work.
However, it still needs to set the flag if the offset to the buffer changes or if the number of constants change. If the buffer itself changes, UpdateBinding() will set the dirty flag.
I've tested the change on an RTX 3070 with a map in CS:GO, and the FPS increased by about around 35%.