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
    Commented Jun 4, 2016 at 13:04
  • \$\begingroup\$ no i am drawing white \$\endgroup\$
    – Philinator
    Commented Jun 4, 2016 at 13:06

1 Answer 1

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
    Commented Jun 4, 2016 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
    Commented Jun 4, 2016 at 17:27
  • \$\begingroup\$ @Philinator You are welcome. \$\endgroup\$ Commented Jun 4, 2016 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
    Commented Jun 4, 2016 at 22:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .