Is it possible to use nvidia Nsight to debug cppwinrt directx12 applications?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Is it possible to use nvidia Nsight to debug cppwinrt directx12 applications?



I have a UWP cppwinrt app that is using directx12 to render a cube with a basic shader. I would like to use a graphics debugger to inspect the data being sent to this shader.



First I am trying to use the Nvidia Nsight debugger for visual studio 2017. The problem is that when I go to "Start Graphics Debugging" from the Nsight menu, the app immediately stop with an error saying: "Failed to launch UWP app (Could not terminate existing process)".



I am able to launch the Nsight debugger on a DirectX12 UWP app (C++/CX) created from the visual studio template though which is encouraging.



My cppWinRT app is rendering to a swapchain created using IDXGIFactory2::CreateSwapChainForComposition like so:


IDXGIFactory2::CreateSwapChainForComposition


check_hresult(
m_factory->CreateSwapChainForComposition(
m_commandQueue.get(),
&swapChainDesc,
nullptr,
m_swapChain.put()
));

// associate DXGI swap chain with the XAML SwapChainPanel
check_hresult(
swapChainPanel().as<ISwapChainPanelNative>()->SetSwapChain(m_swapChain.get())
);



The swapChainPanel() is a winrt::Windows::UI::Xaml::Controls::SwapChainPanel xaml control.


swapChainPanel()


winrt::Windows::UI::Xaml::Controls::SwapChainPanel



Does anyone have an idea how this could be done?



UPDATE 8/13/2018:



I tried using Nsight with a different project from Microsoft that is very similar to mine, which you can find here: https://github.com/Microsoft/DirectX-Graphics-Samples/tree/feature_xaml_template/Templates/DirectX12XamlApp



It has the exact same problem as my project so it seems like the swapChainPanel XAML control is the problem.


swapChainPanel



I suspect that a possible workaround would be to present using a different swapchain when debugging, such as one created with IDXGIFactory2::CreateSwapChainForCoreWindow instead.


IDXGIFactory2::CreateSwapChainForCoreWindow





C++/WinRT is in no way special. It accesses the same Windows Runtime API surface as your DirectX 12 UWP app, regardless of the language projection used by that template (C#, C++/CX, any other). It appears that you are trying to solve the wrong problem.
– IInspectable
Aug 12 at 10:03





@IInspectable Ok it’s good to know that I can trust that cppWinRT is not the problem. There’s definitely some differences between the two apps. I will update the question with more details.
– mbl
Aug 12 at 10:10





Does your app work in normal Visual Studio debugger model?
– Nico Zhu - MSFT
Aug 13 at 2:18





Yes I've been using the visual studio debugger a lot to create the app.
– mbl
Aug 13 at 2:20





Could you share a sample that could reproduce this issue?
– Nico Zhu - MSFT
Aug 13 at 7:45









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered