You can specify the written trace filename by setting the `TRACE_FILE`
environment variable before running.
+For D3D10 and higher you really must use `apitrace trace -a DXGI ...`. This is
+because D3D10-11 API span many DLLs which depend on each other, and once a DLL
+with a given name is loaded Windows will reuse it for LoadLibrary calls of the
+same name, causing internal calls to be traced erroneously. `apitrace trace`
+solves this issue by injecting a DLL `dxgitrace.dll` and patching all modules
+to hook only the APIs of interest.
+
Emitting annotations to the trace
---------------------------------
case trace::API_D3D7:
case trace::API_D3D8:
case trace::API_D3D9:
- case trace::API_D3D10:
- case trace::API_D3D10_1:
- case trace::API_D3D11:
- // Can be used with WINE
+ case trace::API_DXGI:
+ // Use prefix so that it can be used with WINE
retraceName = "d3dretrace.exe";
break;
default:
case trace::API_D3D9:
wrapperFilename = "d3d9.dll";
break;
- case trace::API_D3D10:
- case trace::API_D3D10_1:
- case trace::API_D3D11:
+ case trace::API_DXGI:
wrapperFilename = "dxgitrace.dll";
useInject = true;
break;
api = trace::API_D3D8;
} else if (strcmp(optarg, "d3d9") == 0) {
api = trace::API_D3D9;
- } else if (strcmp(optarg, "d3d10") == 0) {
- api = trace::API_D3D10;
- } else if (strcmp(optarg, "d3d10_1") == 0) {
- api = trace::API_D3D10_1;
- } else if (strcmp(optarg, "d3d11") == 0) {
- api = trace::API_D3D11;
+ } else if (strcmp(optarg, "dxgi") == 0 ||
+ strcmp(optarg, "d3d10") == 0 ||
+ strcmp(optarg, "d3d10_1") == 0 ||
+ strcmp(optarg, "d3d11") == 0 ||
+ strcmp(optarg, "d3d11_1") == 0) {
+ api = trace::API_DXGI;
} else {
std::cerr << "error: unknown API `" << optarg << "`\n";
usage();