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

☆樱花仙子☆ 提交于 2019-12-12 23:13:29

问题


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:

    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.

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.

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

来源:https://stackoverflow.com/questions/51807703/is-it-possible-to-use-nvidia-nsight-to-debug-cppwinrt-directx12-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!