Visual Studio 11的图形调试器的目标应用程序的要求

Visual Studio 11的图形调试器的目标应用程序的要求

问题描述:

当我为Visual Studio 11发布了图形调试器功能时,我非常开心,我立即试图让它在我的各种项目上工作,不幸的是我只能使它适用于Windows 8 Metro应用程序!具体来说,C ++ Metro项目模板可以正确运行并捕获所有预期的信息。

I was super happy when the "Graphics Debugger" feature was announced for Visual Studio 11, I immediately attempted to get it working on various projects I had, unfortunately I've only managed to get it working for Windows 8 Metro applications! Specifically the C++ Metro project templates run and capture all expected information correctly.

使用Visual Studio的开发人员预览版本,在Windows 7上, Debugger(Alt-F5)崩溃在D3D11CreateDeviceAndSwapChain(),即使他们工作正常。在我的Visual Studio 11测试版在Windows 8消费者预览机在工作,我得到一点,图形调试器HUD显示正确,但任何尝试获取捕获(打印屏幕在应用程序或工具栏按钮)一个消息(在输出日志和打开的.vsglog顶部的黄色栏中):

With Developer Preview versions of Visual Studio, and on Windows 7, any attempt to launch applications under the Graphics Debugger (Alt-F5) crash on D3D11CreateDeviceAndSwapChain(), even if they work fine. On my Visual Studio 11 Beta on Windows 8 Consumer Preview machine at work, I get a bit further, the Graphics Debugger HUD displays correctly, but any attempt at getting a capture (Print Screen in the app, or the toolbar button) simply results in a message (in the Output log and a yellow bar at the top of the opened .vsglog):


图形诊断引擎提供结果,很可能是因为vsglog正在使此机器不支持DirectX调用。

The Graphics Diagnostics engine couldn't provide the results, most likely because the vsglog is making DirectX calls not supported on this machine.

这是直接移植的情况Direct3D从Metro模板应用程序调用!我没有看到MSDN文档中的任何消息,这个功能只适用于Metro,所以我希望我只是做一些愚蠢的,但应用程序可以正常工作时,不是在图形调试器。

This is even the case with directly porting the Direct3D calls from the Metro template applications! I don't see any messaging from the MSDN documentation that this feature is only intended for Metro, so I expect I'm simply doing something stupid, but the applications work correctly when not under the Graphics Debugger.

其他信息:D3D11_CREATE_DEVICE_DEBUG设置,使用DirectX控制面板启用Direct3D调试,我期望创建/销毁信息性消息,并且在输出中不会有其他消息。

Other information: D3D11_CREATE_DEVICE_DEBUG is set, with the DirectX control panel enabling Direct3D debugging, and I'm getting expected Create/Destroy informational messages and no other in Output.

Windows 8 :A-ha!通过将另一个调试器附加到图形调试器主机 VsGraphicsDesktopEngine.exe (位于C:\Program Files(x86)\ Microsoft Visual Studio 11.0 \Common7 \IDE\\ \\Extensions\Microsoft\VsGraphics\x86)并通过DirectX控制面板强制Direct3D调试,我得到了输出:

Windows 8: A-ha! Through attaching another debugger to the graphics debugger host VsGraphicsDesktopEngine.exe (found in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\VsGraphics\x86) and forcing Direct3D debugging through the DirectX Control Panel, I got the output:


DXGI错误:在DXGI_SWAP_CHAIN_DESC中未指定目标窗口,并且没有与拥有工厂关联的窗口。 [UNKNOWN ERROR#7:]

DXGI ERROR: No target window specified in DXGI_SWAP_CHAIN_DESC, and no window associated with owning factory. [ UNKNOWN ERROR #7: ]

PIX:IDXGIFactory2 :: CreateSwapChainForHwnd返回887a0001

PIX: IDXGIFactory2::CreateSwapChainForHwnd returned 887a0001

我认为这很奇怪,因为虽然我使用CreateSwapChainForHwnd(),它使用DXGI_SWAP_CHAIN_DESC 1 ,甚至不 字段 OutputWindow 。但是我尝试使用CreateSwapChainForHwnd()与CreateSwapChain()与 OutputWindow 指定和一切正常

I thought that was pretty weird, since although I'm using CreateSwapChainForHwnd(), it uses DXGI_SWAP_CHAIN_DESC1, which doesn't even have the field OutputWindow. However I tried swapping my use of CreateSwapChainForHwnd() with CreateSwapChain() with the OutputWindow specified and everything works!

通过进一步的测试,我发现在D3D11CreateDeviceAndSwapChain()失败,用它运行一个空适配器,但捕获给予的bizzare这个图形诊断引擎不支持D3D9。播放的应用程序可以是任何企图不完整,并使用指定的适配器与此堆栈崩溃:

With further testing, I found any attempt at D3D11CreateDeviceAndSwapChain() fails, with a null adapter it runs, but captures give the bizzare "This Graphics Diagnostics engine doesn't support D3D9. Playback of your application may be incomplete.", and with a specified adapter it crashes with this stack:

04246c83()
[Frames below may be incorrect and/or missing]
dxgi.dll!CDXGIFactory::CreateSwapChainForHwndImpl(struct IUnknown *,struct DXGI_SWAP_CHAIN_DESC_INTERNAL *,bool,struct IDXGIOutput *,struct IDXGISwapChain1 * *)
dxgi.dll!CDXGIFactory::CreateSwapChain(struct IUnknown *,struct DXGI_SWAP_CHAIN_DESC *,struct IDXGISwapChain * *)
VsGraphicsHelper.dll!CHookedIDXGIFactory::CreateSwapChain(struct IUnknown *,struct DXGI_SWAP_CHAIN_DESC *,struct IDXGISwapChain * *)
VsGraphicsHelper.dll!CSpyHookedIDXGIFactory::CreateSwapChain(struct IUnknown *,struct DXGI_SWAP_CHAIN_DESC *,struct IDXGISwapChain * *)
d3d11.dll!_D3D11CreateDeviceAndSwapChain@48()
VsGraphicsHelper.dll!CHookedD3D11Top::D3D11CreateDeviceAndSwapChain(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL *,unsigned int,unsigned int,struct DXGI_SWAP_CHAIN_DESC *,struct IDXGISwapChain * *,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *)
VsGraphicsHelper.dll!CSpyHookedD3D11Top::D3D11CreateDeviceAndSwapChain(struct IDXGIAdapter *,enum D3D_DRIVER_TYPE,struct HINSTANCE__ *,unsigned int,enum D3D_FEATURE_LEVEL *,unsigned int,unsigned int,struct DXGI_SWAP_CHAIN_DESC *,struct IDXGISwapChain * *,struct ID3D11Device * *,enum D3D_FEATURE_LEVEL *,struct ID3D11DeviceContext * *)
Win32ProjectScratch.exe!Direct3DWindowBase::CreateDeviceResources() Line 363
...

看来只有D3D11CreateDevice(),其次是IDXGIFactory :: CreateSwapChain()的作品 - 无论是通过指定的适配器或查询它的工厂后,设备

It seems only D3D11CreateDevice() followed by IDXGIFactory::CreateSwapChain() works - either by specifying an adapter or querying the device for it's factory later.

Windows 7 有另一个问题:你必须使用 D3D11CreateDevice() / IDXGIFactory :: CreateSwapChain()如果你使用DXGI 1.0工厂( CreateDXGIFactory()),它还会在第一个 Present() code>与 CreateDXGIFactory 1 ()):

Windows 7 has another gotcha: you have to use D3D11CreateDevice()/IDXGIFactory::CreateSwapChain() still, but it also raises a DirectX debug layer error on the first Present() if you are using a DXGI 1.0 factory (CreateDXGIFactory() vs. CreateDXGIFactory1()):


D3D11:ERROR:ID3D11Device :: CreateTexture2D:D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX仅适用于从Dxgi1.1工厂或更高版本创建的设备。 [STATE_CREATION ERROR#103:CREATETEXTURE2D_INVALIDMISCFLAGS]

D3D11: ERROR: ID3D11Device::CreateTexture2D: D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX is only available for devices created off of Dxgi1.1 factories or later. [ STATE_CREATION ERROR #103: CREATETEXTURE2D_INVALIDMISCFLAGS ]

如果您已启用调试层你应该),这将在调试器引发异常,使得它看起来像另一个崩溃,但它是安全的可持续 - 但你没有得到VS图形调试器HUD和对象表的窗口已经打破的内容。另一方面,如果你遵循它的建议,并使用DXGI 1.1工厂,你会在Present()中真正崩溃。

If you have the debug layer "break on severity" option turned on (which in general, you should), this will raise an exception in the debugger, making it look like another crash, however it is safely continuable - however you don't get the VS Graphics Debugger HUD, and the object table window has broken content. On the other hand, if you follow it's advice and use a DXGI 1.1 factory, you get a real crash in Present().

总之,看起来图形调试器

In summary, it seems the graphics debugger isn't quite fully baked yet!