2
\$\begingroup\$

I've got a problem with DirectX 12 I cannot figure out by myself. I wrote a small program that should render a triangle onto the screen. When I executed the application, however, there was no triangle visible. So I launched NVidia's nsight debugger. The weird thing is that the triangle has been drawn to the depth-stencil buffer but not to the back buffer.

enter image description here

If I clear the render target view to light blue it would look like this:

enter image description here

If you need any code snippets please write it in the comments and I will post it.

Thanks in advance

\$\endgroup\$
2
  • \$\begingroup\$ Are you drawing black on black? \$\endgroup\$ – tkausl Jun 4 '16 at 13:04
  • \$\begingroup\$ no i am drawing white \$\endgroup\$ – Philinator Jun 4 '16 at 13:06
3
\$\begingroup\$

Start graphics debugging (ALT+F5) your program with visual studio directX graphics diagnostic and capture a frame, then double click on the thumbnail of frame and view your event list and your pipeline. It will help you to find out whats really happening down there. May be you forgot to set and clear your render target view before drawing vertices.

read this article for better understanding: DirectX Graphics Diagnostic

\$\endgroup\$
4
  • \$\begingroup\$ thank you very much. Apparently the pixels of the triangle get excluded because the render target write mask is set to all zeros. You have any idea where to set this mask? \$\endgroup\$ – Philinator Jun 4 '16 at 17:11
  • 1
    \$\begingroup\$ Ok I got it. I forgot to set the blend state in the D3D12_GRAPHICS_PIPELINE_STATE_DESC struct. Now it works like a charm. Thanks again. \$\endgroup\$ – Philinator Jun 4 '16 at 17:27
  • \$\begingroup\$ @Philinator You are welcome. \$\endgroup\$ – Pooya Eimandar Jun 4 '16 at 20:11
  • \$\begingroup\$ @Philinator It is a bad habit to post duplicate question accross stackoverflow. I answered you to the other one by the way ! \$\endgroup\$ – galop1n Jun 4 '16 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.