What is dxdiag?

I see it in the system32 folder in windows, but what does it do?