Skip to main content
Visual Studio 2012
Graphics Pipeline Stages

The Graphics Pipeline Stages window, which is one of the Graphics Diagnostics tools in Visual Studio, can help you understand how a particular draw event moves through the graphics pipeline.

This is the Graphics Pipeline Stages window:

A 3-D object goes through the pipeline stages.
NoteNote

Starting in Visual Studio 2013 Update 3, the Graphics Diagnostics tool windows are hosted in an independent copy of the Visual Studio shell. This customized shell, called Graphics Analysis, eliminates unnecessary menus and options, but otherwise the graphics pipeline stages window and workflow are the same as before. For more information about this change, see Graphics Diagnostics Overview.

Understanding the Graphics Pipeline Stages window

The Graphics Pipeline Stages window can help you analyze the output of each stage of the graphics pipeline that applies to a specific object that was rendered. In particular, you can identify stages in which the data was misinterpreted or transformed incorrectly—for example, you can investigate whether a vertex shader stage caused an object to be drawn off-screen. When you have identified the pipeline stage in which the problem occurs, you can use the other Graphics Diagnostics tools to examine how the data was interpreted or transformed. Rendering problems that appear in the pipeline stages are often related to incorrect vertex format descriptors, buggy shader programs, or misconfigured device state.

Graphics pipeline stages

The Graphics Pipeline Stages window displays graphics data only for the stages of the pipeline that were active during the draw call. To use the graphics tools in Visual Studio to examine the output of each displayed stage, choose the associated thumbnail in the Graphics Pipeline Stages window.

Compute shaders are not supported in the Graphics Pipeline Stages window.

Input Assembler

Reads index and vertex data that's supplied by the app and assembles it for the graphics hardware. The thumbnail displays a wireframe model of the assembled vertices. The vertex data that corresponds to position is determined by the POSITION semantic. If the POSITION semantic is not present in the input assembler output, then nothing is displayed in the Input Assembler stage. You can use the Model Editor to examine the output of the Input Assembler stage.

Vertex Shader

Processes vertices, typically by performing operations such as transformations, skinning, and lighting. A vertex shader always takes one vertex input and produces one vertex output. The thumbnail displays a wireframe image of the transformed geometry. The vertex data that corresponds to position is determined by the POSITION or SV_POSITION semantics. If the POSITION or SV_POSITION semantics are not present in the vertex shader output, then nothing is displayed in the Vertex Shader stage. You can use the Image Editor to examine the output of the Vertex Shader stage.

Hull Shader

Direct3D 11 only. Processes geometric primitives—such as quads, triangles, or lines—into low-order geometric patches that serve as input to the fixed-function tessellation stage. No thumbnail is displayed for the Hull Shader.

Domain Shader

Direct3D 11 only. Processes subdivision vertices that are output by the fixed-function tessellation stage, similar to the vertex shader stage. No thumbnail is displayed for the Domain Shader stage.

Geometry Shader

Processes entire primitives—points, lines, or triangles—along with optional vertex information for adjacent primitives. A geometry shader can discard the primitive or emit one or more new primitives. The thumbnail displays a wireframe image of the transformed geometry. You can use the Image Editor to examine the output of the Geometry Shader stage.

Pixel Shader

Processes interpolated vertex data to generate colored pixels. The thumbnail displays an image of the pixel shader output. You can use the Image Editor to examine the output of the Pixel Shader stage.

Output Merger

Combines various kinds of shader results—for example, pixel shader values and depth information— together with the contents of the render target and depth buffer, along with stencil buffer information, to determine how the render target is affected. The thumbnail displays an image of the render target contents after the various results have been merged and the contents of the stencil buffer have been considered. You can use the Image Editor to examine the output of the Output Merger stage.

Viewing and debugging shader code

You can view the code for a Vertex Shader, Hull Shader, Domain Shader, Geometry Shader, or Pixel Shader, or debug it, by using the controls below the pipeline stage that's associated with the shader.

To view a shader's source code

  • Below the pipeline stage that's associated with the shader that you want to view, choose the title of the pipeline stage—for example, choose Vertex Shader to view the vertex shader source code.

To debug a shader

  • Below the shader stage that's associated with the shader that you want to debug, below the title of the pipeline stage, choose Start Debugging. This entry point into the HLSL debugger debugs only the first shader invocation for the corresponding stagethat is, the first vertex, primitive, or pixel that is processed. Other invocations of these shader stages can be accessed by using the Graphics Pixel History.

Link to the graphics device

To understand why a draw call interacts in a particular way with the graphics pipeline, you might need information about the current device state. The Graphics Pipeline Stages window provides a link to this information.