Visual Studio 2012 graphical debugger and offscreen buffers

Started by
1 comment, last by GuyWithBeard 11 years ago

Hi,

Using the new VS2012 graphical debugger it is very easy to take a snapshot of a frame (eg. by pressing Print Screen), and getting the contents of the back buffer into the debugger where you can inspect the pixel history etc. However, I have several offscreen buffers the content of which I would like to inspect in the same way. My engine renders the scene something like:

1. Render all shadow maps

2. Render the view space normals and depth to a buffer for SSAO use

3. Calculate the SSAO

4. Render the main scene.

What if I wanted to inspect one of the shadow maps or the SSAO normal/depth map? How do I get those buffers into the debugger?

Thanks!

Advertisement

The easiest way to do it is to pull up the Graphics Event List, and find the draw call(s) where you draw to that render target. When you select the draw call, the render target will pop up the graphics experiment view.

For finding draw calls it helps to wrap related sections in events using ID3DUserDefinedAnnotation*. That you can quickly see where you shadow pass is, or your SSAO pass, or whatever you're looking for. The arrows at the top of the event list will jump to the previous or next draw call, which is also handy.

*The old way to do this is to use D3DPERF_BeginEvent and D3DPERF_EndEvent, which were used for PIX. These still work with the VS 2012 debugger, but they require linking to d3d9.lib.

Ah, it was that easy :)

I have not added annotations yet, but I definitely need to do it, thanks for the info.

This topic is closed to new replies.

Advertisement