Game Development Reference
In-Depth Information
Figure 21.6. The Pixel History Page.
21.3 Debugging an HLSL Shader
The Parallel Nsight Shader Debugger allows the debugging of any type of Direct3D
HLSL shader, including pixel, vertex, geometry, tessellation, and compute shaders.
In addition, it does so using the same Microsoft Visual Studio user interface and
key bindings used for debugging CPU code.
Parallel Nsight actually debugs graphics and computes shaders directly on the
GPU hardware, so debugging shaders inside a game is significantly faster and more
accurate. Because this requires special hardware features, it is only available on
NVIDIA hardware.
The following sections cover how to debug shaders in Parallel Nsight, including
how to find the shader you'd like to debug, how to set breakpoints (including
hardware conditional breakpoints), and how to inspect shader variables.
21.3.1 Finding a Shader to Debug
One difference between debugging your code on the CPU and debugging shader
code on the GPU is that the game must submit shader code to the GPU through
an API, such as Direct3D. Shader code also often does not reside on disk, and it
can be generated at runtime or embedded in CPU source code directly as a literal
and may be pieced together from a number of snippets. Thus, the only way to find
the source code for a particular shader is to use the Parallel Nsight Shaders tool
window or the Debug this Pixel link from a Pixel History.
 
Search WWH ::




Custom Search