|
|

楼主 |
发表于 2008-4-12 15:18:00
|
显示全部楼层
Re:HLSL怎样DEBUG?我的是Visual Studio2008
哦,在GameDev找到PixDebug的方法了:
1. Open Pix for Windows and go to File->New Experiment
2. To the right of the Program path dialog box you’ll see a epsilon button (…). Click it and navigate the file browser to you C project’s output directory and select the output executable of the Direct3D program that you want to debug. You will return to the previous dialog.
3. In the lower area of the dialog you will see “What information do you want to gather?”. Select the 2nd option “A single-frame capture of Direct3D whenever F12 is pressed.
4. In the lower right of the dialog click the Start Experiment.
5. Your program will start and you will see a frame count in the upper left of the applications renderable area. Whenever you’re at the area that you want to debug press the F12 button. It will flash a notice under the frame count for a second saying that it has successfully captured frame data. You can now close you application.
6. When you’re application closes the Pix application loads the captured frame. In the lower right area of Pix you will see a Details window. In the Details window there will be three tabs (“Summary”, “Render” and “Mesh”) . Activate the “Render” tab.
7. A visible rendition of your projects screen will appear in the “Render” tab’s window. Position the mouse over a particular pixel you wish to debug and right-click with the mouse. This will bring up the context menu with a few options. Left-click on the option that says “Debug This Pixel”.
8. The “Debugger” Tab will then be added to the Details window. You can scroll down thru this window’s Pixel History and you will see different events for each pass of the video hardware. Within the different events you will see a few hyperlinks that say “Debug Vertex 0” or “Debug Pixel (405,231)”. As you can guess these correspond to debugging the vertex and pixel shader programs respectively. Left-clicking on a desired hyper-link will bring you to a debug window that allows you to debug the shaders.
9. In the shader debugger window there is a top bar that has icon buttons for stepping forward or backward etc. You can left-click on the blank area to the left of the debug window to set break points.
10. There is a lower pane within the Shader Debugger that displays register values. Use these to track values and such.
Good Luck and I hope this helps,
|
|