简体   繁体   English

如何在Visual Studio 2017中启动HLSL调试器?

[英]How do I launch the HLSL debugger in Visual Studio 2017?

I cant find the option to launch the HLSL Debugger in Visual Studio 2017. 我找不到在Visual Studio 2017中启动HLSL调试器的选项。

The Microsoft document instructs to launch it from Graphics Pipeline Stages window or Graphics Pixel History Microsoft文档指示从Graphics Pipeline Stages窗口或Graphics Pixel History启动它

https://msdn.microsoft.com/en-us/library/hh873197.aspx https://msdn.microsoft.com/en-us/library/hh873197.aspx

However, I have no idea what those are or how to get to them 但是,我不知道它们是什么或如何到达它们

When I set a breakpoint in hlsl code in visual studio IDE directly, it just shows " The Breakpoint will not currently be hit " over the empty red circle. 当我直接在visual studio IDE中的hlsl代码中设置断点时,它只显示空红色圆圈上的“ The Breakpoint will not currently be hit ”。 I assume I need to open the hlsl code in the hlsl debugger for it to break on the line. 我假设我需要在hlsl调试器中打开hlsl代码,以便它在行中断开。

I'm running a new project template DirectX 11 App(Universal Windows) in x64 debug mode and setting breakpoints in both vertex and pixel shaders. 我正在x64调试模式下运行一个新的项目模板DirectX 11 App(Universal Windows) ,并在顶点和像素着色器中设置断点。

Thanks, 谢谢,

  1. Make sure that your shaders are compiled with debug support - with /Zi option if you are using HLSL compiler. 确保使用调试支持编译着色器 - 如果使用HLSL编译器,则使用/Zi选项。
  2. Make sure that DX device is created with debug enabled ( D3D11_CREATE_DEVICE_DEBUG flag). 确保在启用调试的情况下创建DX设备( D3D11_CREATE_DEVICE_DEBUG标志)。
  3. Start GFX debugging session by going to Main menu -> Debug -> Graphics -> Start Graphics debugging. 通过进入主菜单 - >调试 - >图形 - >启动图形调试启动GFX调试会话。 This will make a window asking for elevated privileges to pop up, launch your program and show diag session window with "Capture frame" button and timeline. 这将创建一个窗口,要求提升权限,启动程序并使用“捕获帧”按钮和时间线显示诊断会话窗口。
  4. Now make your application display desired image and capture a frame(s) of iterest using corresponding button. 现在让您的应用程序显示所需的图像,并使用相应的按钮捕获迭代的帧。 Captured frame screenshot will appear in the list. 捕获的帧截图将出现在列表中。
  5. Close your application. 关闭你的申请。 This will trigger finalization (some postprocessing) of diag session which will take some time. 这将触发diag会话的最终化(一些后处理),这将花费一些时间。
  6. Click on the frame name (blue) in the list of captured frames. 单击捕获帧列表中的帧名称(蓝色)。 This will open VS graphics analyzer window - this is where you actually debug graphics. 这将打开VS图形分析器窗口 - 这是您实际调试图形的地方。
  7. In the middle there will be a (reproduced) frame render screenshot - you can click anywhere on it and at the pixel history window there should be a list of draw calls modifying that pixel. 在中间会有一个(转载的)帧渲染截图 - 你可以点击它上面的任何地方,在像素历史窗口,应该有一个修改该像素的绘制调用列表。 By expanding this list you should be able to locate invocation of shader of interest. 通过扩展此列表,您应该能够找到感兴趣的着色器的调用。 It should have "Play" triangle button starting shader debugging and jumping into shader code where you can inspect variables, set breakpoints and other stuff. 它应该有“Play”三角形按钮启动着色器调试并跳转到着色器代码,您可以在其中检查变量,设置断点和其他内容。
  8. Alternatively on the left there will be Event list that contains all the pipeline modification and draw (marked with brush) calls. 或者在左侧有一个事件列表,其中包含所有管道修改和绘制(用画笔标记)调用。 Locate a draw call of interest there and select it. 在那里找到感兴趣的抽奖电话并选择它。 In the Pipeline stages window there should be a diagram with screenshots of products of each stage with a corresponding shader link and "Play" button that starts shader debugging. 在Pipeline阶段窗口中,应该有一个图表,其中每个阶段的产品的屏幕截图都有相应的着色器链接,而“Play”按钮则启动着色器调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以在Visual Studio 2017调试器中查看未处理的异常吗? - Can I view an unhandled exception in the Visual Studio 2017 Debugger? 如何编写一个非常简单的Visual Studio调试器可视化工具? - How do I write a very simple Visual Studio debugger visualizer? 如何在Visual Studio 2017中成功包含SDL2? - How do I sucessfully include SDL2 in Visual Studio 2017? 在Visual Studio 2017中禁用烦人的调试器通知 - Disabling an annoying debugger notification in Visual Studio 2017 如何在 Visual Studio 2017 中无错误地打开 Visual Studio 2019 c++ 代码? - How do i open Visual Studio 2019 c++ code in Visual Studio 2017 without errors? 如何使 Visual Studio 远程调试器 2017 和 2019 都在同一台计算机上工作? - How to make Visual studio Remote debugger 2017 and 2019 both work on a same computer? 如何在 Visual Studio 2017 中为 C++ 控制台应用程序添加 header 文件 - How do I add header file for a C++ console app in Visual Studio 2017 如何安装 Windows 10 SDK 以与 Visual Studio 2017 一起使用 - How do I install Windows 10 SDK for use with Visual Studio 2017 Visual Studio:如何在修改成员变量时停止调试器? - Visual Studio: how do I have the debugger stop when a member variable is modified? 在Visual Studio调试器中,如何从内存中打印一系列字节? - In the Visual Studio debugger, how do I print a range of bytes from memory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM