D3DSpy is a tool that monitors function calls to the Direct3D API, and shows a representation of Direct3D's internal state. This is valuable when writing a D3D program, or trying to understand why it is behaving as it is. It can also be used to improve the performance of a D3D program by indentifying redundant or inefficient use of the API.
D3DSpy can monitor a program that is running on the same machine as the D3DSpy user interface, or it can monitor a program running on a different computer, communicating via DirectPlay.
D3DSpy works by providing a proxy DLL, which the application connects to and treats like the real D3D9.DLL. It intercepts all the calls and gathers various information before making the real D3D call.