]> git.cworth.org Git - apitrace/commitdiff
Drop API_D3D10/11.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 7 Dec 2012 07:48:10 +0000 (07:48 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 7 Dec 2012 07:48:10 +0000 (07:48 +0000)
README.markdown
cli/cli_retrace.cpp
cli/cli_trace.cpp
common/trace_api.hpp
gui/retracer.cpp

index c82149545f474e90b5e3135214470da0ab7a0ebd..b1eb08397aa4bf1a64d1db5b2e7cf3dd11248599 100644 (file)
@@ -241,6 +241,13 @@ Then run the application as usual.
 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
 ---------------------------------
index 062f51bdded2456bd6ca33959c421c10c72abecf..e4d8f788f972d40b23b3803f02721500b7a2e879 100644 (file)
@@ -76,10 +76,8 @@ executeRetrace(const std::vector<const char *> & opts,
     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:
index 1d19ed5c5ba11e9662d3253192d2ca5e26869122..2646ffd8a0190c1bd80b621145c3dd1162efb5e5 100644 (file)
@@ -116,9 +116,7 @@ traceProgram(trace::API api,
     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;
@@ -270,12 +268,12 @@ command(int argc, char *argv[])
                 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();
index 4c896dbfaed52cf57f28a1f66cd2ae08545221a2..3d491fe1054eb66f61e96aced45676ac8a129923 100644 (file)
@@ -48,9 +48,7 @@ enum API {
     API_D3D7,
     API_D3D8,
     API_D3D9,
-    API_D3D10,
-    API_D3D10_1,
-    API_D3D11,
+    API_DXGI, // D3D10.x, D3D11.x
 };
 
 
index c6698f75e709c8cb769514ceebe22d74de2f2642..738367e1830c394f2808ab8a234355dd8de8e48a 100644 (file)
@@ -271,9 +271,7 @@ void Retracer::run()
     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:
+    case trace::API_DXGI:
 #ifdef Q_OS_WIN
         prog = QLatin1String("d3dretrace");
 #else