Jump to content
  • Advertisement
Sign in to follow this  
Foxbane

DX11 Noob question - only first frame appears

This topic is 477 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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....

Share this post


Link to post
Share on other sites
Advertisement

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).

Edited by Jesse Natalie

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!