Game Development Reference
In-Depth Information
Figure 21.7. The Shaders tool window.
Using the shaders tool window. The Parallel Nsight Shaders tool window offers
a straightforward way to see all shaders that have been loaded by your applica-
tion. Once your game is launched and starts loading shaders, this tool window
automaticallypopulateswithinformationabouttheseshaders(see Figure21.7 ) .
Double-clicking a shader in this window will open the source code for that
shader, and at that point the shader can be debugged like other source code in
Visual Studio (described in Section 21.3.2).
Using the Debug Pixel in Pixel History. Pixel History (see Section 21.2.6) offers
another way to find and debug a shader specific to pixel shaders. This feature shows
all operations (draw and clear calls) that affected a given pixel on a render target.
Once you have run the Pixel History, described above, you can select Debug Pixel
to focus the debugger on the given pixel and shader.
21.3.2 Source Debugging of Shaders
Once the desired shader is identified, debugging a shader is nearly identical to
debugging any other type of code inside Microsoft Visual Studio. Halt execution
anywhere in the shader using standard breakpoints, view local variables and condi-
tionals, switch to other active primitives in flight using the Graphics Debug Focus,
and even set conditional breakpoints that execute on the hardware to detect and
halt on any specific user-defined reason. The major advantage is that everything
is running on the hardware, so it is very fast, and you are seeing the exact values
the hardware is using to calculate any given output instead of a CPU simulation of
them.
Breakpoints. A key feature of any source debugger is the ability to set a breakpoint
at a particular line of source code, such that the executing code halts at the location
 
Search WWH ::




Custom Search