C# 无法将图形诊断加载到VS.net 2015图形分析器中
我在C#,VS.net 2015 Update 3中有一个解决方案,它使用适用于DirectX11的SharpDX 3.1包装器(截至目前为止的最新NuGet)。该解决方案运行良好,但我想使用内置的VS.net图形探查器来检查性能 我使用VS.net“调试->图形->启动图形调试”启动解决方案,并成功捕获诊断会话中显示的屏幕截图。单击链接以查看框架将在我的临时文件夹中创建一个.vsglog和子文件夹,并将该.vsglog文件加载到Visual Studio图形分析器(“VSGA”) 问题在于VSGA始终显示错误“图形诊断引擎遇到致命错误。请尝试重新打开文档…”,该错误记录在Windows事件查看器中(因此可能表示真正的崩溃) 我试过了C# 无法将图形诊断加载到VS.net 2015图形分析器中,c#,visual-studio-2015,directx,sharpdx,C#,Visual Studio 2015,Directx,Sharpdx,我在C#,VS.net 2015 Update 3中有一个解决方案,它使用适用于DirectX11的SharpDX 3.1包装器(截至目前为止的最新NuGet)。该解决方案运行良好,但我想使用内置的VS.net图形探查器来检查性能 我使用VS.net“调试->图形->启动图形调试”启动解决方案,并成功捕获诊断会话中显示的屏幕截图。单击链接以查看框架将在我的临时文件夹中创建一个.vsglog和子文件夹,并将该.vsglog文件加载到Visual Studio图形分析器(“VSGA”) 问题在于VS
- 在两台运行VS.net 2015 Community Edition的机器上,使用不同的图形卡
- 将我的应用程序切换到使用Warp(软件仿真DirectX11层)
- 根据谷歌的其他建议,我将我的应用程序限制为在设备创建期间使用功能级别11
- 遵循谷歌的其他建议,使用DirectX控制面板强制VSGA使用Warp
- 我已经将VS.net和VSGA标记为“以管理员身份运行”
Im使用安装了可选图形工具功能的Windows 10 有关信息,我的设备创建代码为
private static void initializeDirect3DGraphicsDevice(System.Windows.Forms.Control winFormsControl, out Device device, out SharpDX.DXGI.SwapChain sc)
{
// SwapChain description
SharpDX.DXGI.SwapChainDescription destination = new SharpDX.DXGI.SwapChainDescription()
{
BufferCount = 1,
ModeDescription = new SharpDX.DXGI.ModeDescription(
winFormsControl.ClientSize.Width,
winFormsControl.ClientSize.Height,
new SharpDX.DXGI.Rational(60, 1),
SharpDX.DXGI.Format.R8G8B8A8_UNorm),
IsWindowed = true,
OutputHandle = winFormsControl.Handle,
SampleDescription = new SharpDX.DXGI.SampleDescription(1, 0),
SwapEffect = SharpDX.DXGI.SwapEffect.Discard,
Usage = SharpDX.DXGI.Usage.RenderTargetOutput
};
// https://connect.microsoft.com/VisualStudio/feedback/details/3102011/the-graphics-debugger-fails-to-load-on-gtx-1080
// To enable graphics debugging we avoid featre levels above 11.
SharpDX.Direct3D.FeatureLevel[] featureLevels = new SharpDX.Direct3D.FeatureLevel[]
{
SharpDX.Direct3D.FeatureLevel.Level_11_0
};
device = new Device(SharpDX.Direct3D.DriverType.Hardware, DeviceCreationFlags.Debug, featureLevels);
using (SharpDX.DXGI.Factory1 factory = new SharpDX.DXGI.Factory1())
{
sc = new SharpDX.DXGI.SwapChain(factory, device, destination);
factory.MakeWindowAssociation(winFormsControl.Handle, SharpDX.DXGI.WindowAssociationFlags.IgnoreAll);
}
System.Diagnostics.Debug.WriteLine("Device created with feature level " + device.FeatureLevel);
}
您使用的是什么操作系统?“我正在使用Windows 10,并安装了可选的图形工具功能”