0

I am trying to render multiple models on DirectX 12 using only one graphic context, but the result is very weird and I have not much idea what is the reason. enter image description hereRendering result of the sponza model from outside, the one on right is the correct result and the one on left has problem.

enter image description hereRendering result of the left sponza (the one has problem) from inside.

Even the loaded two meshes are the same, each model has its own vertex buffer, index buffer and SRVs. In the process of creating graphics context, there is only one graphics context and set with each model's index and vertex buffer, and then I call the drawIndexed() function to render it. After the graphics context is created, we execute the graphics context once per frame. However, if we create an individual graphics context to each model and execute all graphics contexts per frame, the rendering works fine but the frame rate drops a lot.

It will be very helpful for you to provide any hints about what is the reason for the weird result, or providing a solution is even better. Thank you very much in advanced.

Michael Wei
  • 185
  • 2
  • 10
  • What are you calling graphic context ? there is no such things in d3d12, are you talking about command list instead ? – galop1n Aug 11 '16 at 21:26
  • Yes. The graphic context is a structure defined in the mini engine from DirectX 12 samples. – Michael Wei Aug 12 '16 at 03:51
  • Direct3D 12 adds numerous additional ways to mess up rendering over Direct3D 11, so it is important to be well practiced at debugging graphics issues before attempting to use DX12. You need to change one thing at a time until you isolate the problem, and keep in mind that with DX12 you may need additional fences, rendering barriers, or other changes to control when you reuse resources. You should also try use the WARP to make sure it isn't some driver-specific issue. – Chuck Walbourn Aug 12 '16 at 04:40

1 Answers1

-1

First, i would recommend you to stay away from dx12 and stick to dx11, unless you are a dx11 expert already and that you are the top 1% application case, like triple A games or very specific high demand on control over the gpu memory.

Without much details on your problems here, i can only give you a few basic advices :

  1. Run with the debug layer and look at the console log with D3D12GetDebugInterface ( you will need to install the optional feature named graphic tools )
  2. Use frame capture tools, like VSGD in visual studio or nsight from nVidia and inspect your frame step by step
  3. Use Dx11, really
galop1n
  • 8,573
  • 22
  • 36