Command-Line Capture Tool
DXCap.exe is a command-line tool for graphics diagnostics capture and playback. It supports Direct3D 10 through Direct3D 12 across all feature levels.
DXCap.exe [-file filename] [-frame frames | -period periods | -manual] -c app [args...] DXCap.exe -p [filename] [-debug | -warp | -hw] [-config] [-rawmode] DXCap.exe –p [filename] –screenshot [-frame frames] DXCap.exe –p [filename] –toXML [xml_filename] DXCap.exe –v [–file filename] [-examine events] [-haltonfail | -exitonfail] [-showprogress] DXCap.exe -e [search_string] DXCap.exe –info
Use –c to specify the app from which you want to capture graphics information.
DXCap.exe –c BasicHLSL11.exe
By default, graphics information is recorded to a file named <appname>-<date>-<time>.vsglog. Use –file to specify a different file to record to.
DXCap.exe –file regression_test_12.vsglog –c BasicHLSL11.exe
Specify additional command-line parameters to the app that you're capturing from by including them after the app's filename.
DXCap.exe –c "C:\Program Files\Internet Explorer\iexplorer.exe" "www.fishgl.com"
The command in the example above captures graphics information from the desktop version of Internet Explorer while viewing the webpage located at www.fishgl.com which uses the WebGL API to render 3-D content.
Because command line arguments that appear after the app are passed to it, you must specify the arguments intended for DXCap.exe before using the –c option.
You can capture graphics information from a Windows Store app.
DXCap.exe –c Microsof.BingMaps_2.1.2914.1734_x64__8wekyb3d8bbwe,AppexMaps
Using DXCap.exe to capture from a Windows Store app is similar to using it to capture from a Windows desktop app, but instead identifying a desktop app by its filename, you identify a Windows Store app by its package name and the name or ID of the executable inside that package that you want to capture from. To make it easier to find out how to identify the Windows Store apps that are installed on your machine, use the –e option with DXCap.exe to enumerate them:
You can provide an optional search string to help find the app that you're looking for. When the search string is provided, DXCap.exe enumerates the Windows Store apps whose package name, app name or app IDs match the search string. The search is case-insensitive.
DXCap.exe –e map
The command above enumerates Windows Store apps that match "map"; here is the output:
Package "Microsoft.BingMaps": InstallDirectory : C:\Program Files\WindowsApps\Microsoft.BingMaps_2.1.2914.1734_x64__8wekyb3d8bbwe FullName : Microsoft.BingMaps_2.1.2914.1734_x64__8wekyb3d8bbwe UserSID : S-1-5-21-2127521184-1604012920-1887927527-5603533 Name : Microsoft.BingMaps Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US Version : 2.1.2914.1734 Launchable Applications: Id : AppexMaps Exe : C:\Program Files\WindowsApps\Microsoft.BingMaps_2.1.2914.1734_x64__8wekyb3d8bbwe\Map.exe IsWWA: No AppSpec (to launch): DXCap.exe -c Microsoft.BingMaps_2.1.2914.1734_x64__8wekyb3d8bbwe,AppexMaps
The last line of output for each enumerated app displays the command you can use to capture graphics information from it.
Use –frame to specify the frames that you want to capture using commas and ranges:
DXCap.exe –frame 2,5,7-9,15 –c SimpleBezier11.exe
Or, use –period to specify a set of time ranges during which to capture frames. Time ranges are specified in seconds, and multiple ranges can be specified:
DXCap.exe –period 2.1-5, 7.0-9.3 –c SimpleBezier11.exe
Use –manual to capture frames interactively. Press the Enter key to start capture, and press the Enter key again to stop.
DXCap.exe –manual -c SimpleBezier11.exe
Use -rawmode to play back captured commands exactly as they occurred. Under normal playback, certain commands are emulated, for example, a graphics log file captured from a full screen app will play back in a window; with raw mode enabled, the same file will attempt to play back in full screen.
DXCap.exe –p regression_test_12.vsglog -rawmode
You might want to force play back of a graphics log file captured on a hardware device to use WARP, or force playback of a log captured on WARP to use a hardware device. Use -warp to play back using WARP.
DXCap.exe –p regression_test_12.vsglog -warp
Use -hw to play back using hardware.
DXCap.exe –p regression_test_12.vsglog -hw
Under validation mode, the graphics log file is played back on both hardware and WARP, and their results are compared. This can help you identify rendering errors that are caused by the driver. Use –v to validate correct behavior of graphics hardware against WARP.
DXCap.exe -v regression_test_12.vsglog
To reduce the amount of comparisons, you can specify a subset of commands for validation to compare and other commands will be ignored. Use –examine to specify the commands whose results you want to compare.
DXCap.exe -v regression_test_12.vsglog –examine present,draw,copy,clear
To view or analyze frames from a graphics log file, DXCap.exe can save captured frames as .png (Portable Network Graphics) image files. Use -screenshot to under playback mode to output captured frames as .png files.
DXCap.exe -p BasicHLSL11.vsglog -screenshot
Use –frame with –screenshot to specify the frames that you want to output.
DXCap.exe -p BasicHLSL11.vsglog -screenshot –frame 5, 7-9
To process and analyze graphics logs using familiar tools like FindStr or XSLT, DXCap.exe can convert a graphics log file to XML. Use -toXML under playback mode to convert the log to XML instead of playing it back.
DXCap.exe –p regression_test_12.vsglog –toXML
By default, the XML output is written to a file with the same name as the graphics log, but which has been given a .xml extension. In the example above, the XML file will be named regression_test_12.xml. To give the XML file a different name, specify it after -toXML.
DXCap.exe –p regression_test_12.vsglog –toXML temp.xml
The resulting file will contain XML that looks similar to this:
<Moment value="67"/> <Method name="CreateDXGIFactory1" > <Return type="HRESULT" value="S_OK" /> <Parameter name="riid" type="IID" value="770AAE78-F26F-4DBA-A829-253C83D1B387" /> <Parameter name="ppFactory" type="void" handle="1" isOutput="true" /> </Method> <Moment value="167"/> <Method name="D3D11CreateDevice" > <Return type="HRESULT" value="S_OK" /> <Parameter name="pAdapter" type="IDXGIAdapter" handle="34" /> <Parameter name="DriverType" type="D3D_DRIVER_TYPE" value="D3D_DRIVER_TYPE_UNKNOWN" /> <Parameter name="Software" type="HMODULE" value="pointer" /> <Parameter name="Flags" type="UINT" value="0" /> <Parameter name="pFeatureLevels" type="D3D_FEATURE_LEVEL" arrSize="1" > <Element value="D3D_FEATURE_LEVEL_11_0" /> </Parameter> <Parameter name="FeatureLevels" type="UINT" value="1" /> <Parameter name="SDKVersion" type="UINT" value="7" /> <Parameter name="ppDevice" type="ID3D11Device" handle="35" isOutput="true" /> <Parameter name="pFeatureLevel" type="D3D_FEATURE_LEVEL" value="D3D_FEATURE_LEVEL_11_0" isOutput="true" /> <Parameter name="ppImmediateContext" type="ID3D11DeviceContext" value="nullptr" isOutput="true" /> </Method>