Adding DX11 support to my graphics engine. For a simple initial test I'm just clearing the screen and rendering a triangle. The first frame generated displays as expected. Subsequent frames clear the screen correctly ( I vary the background color to make sure ) but do not display the triangle. So I figured I'd try out the "Graphics Debugging" is VS2015 to see what is going on. After capturing a few frames the initial "diagsession" report shows the frames rendering incorrectly ( no triangle ). However when I bring up the "Graphics Analyzer" the "vsglog" report shows the frame with the triangle rendered correctly. Ugh. So now I'm not sure where to look in the code for the bug. I'm sort of thinking that since the graphics analyzer shows the correct image the buffer/shader setup is probably correct and the error is in how I handle the framebuffer. But any suggestions welcome....
Noob question - only first frame appears
If your swapchain type is DXGI_SWAP_EFFECT_FLIP_SEQUNTIAL or FLIP_DISCARD, you might be missing a call to OMSetRenderTargets. These swapchain types will unbind the back buffer after calling Present.
I should also point out that you should run with the D3D11 debug layer, as it would almost definitely complain that you're calling Draw() without having a render target bound (assuming that's the problem).
If your swapchain type is DXGI_SWAP_EFFECT_FLIP_SEQUNTIAL or FLIP_DISCARD, you might be missing a call to OMSetRenderTargets. These swapchain types will unbind the back buffer after calling Present.
I should also point out that you should run with the D3D11 debug layer, as it would almost definitely complain that you're calling Draw() without having a render target bound (assuming that's the problem).
Jesse the hero! That was exactly the problem. I added OMSetRenderTargets after Present and all is right with the world.
With the bug in place and the debug layer enabled it does indeed show an error of "Pixel Shader expects a Render Target View yadda yadda".
Thanks for the help.