summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/cli_trace.cpp4
-rw-r--r--common/trace_api.hpp3
-rw-r--r--common/trace_parser.cpp12
-rw-r--r--common/trace_tools_trace.cpp6
-rw-r--r--gui/retracer.cpp23
-rw-r--r--gui/tracedialog.cpp2
6 files changed, 43 insertions, 7 deletions
diff --git a/cli/cli_trace.cpp b/cli/cli_trace.cpp
index a67416b1..80775090 100644
--- a/cli/cli_trace.cpp
+++ b/cli/cli_trace.cpp
@@ -104,6 +104,10 @@ command(int argc, char *argv[])
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 {
std::cerr << "error: unknown API `" << optarg << "`\n";
usage();
diff --git a/common/trace_api.hpp b/common/trace_api.hpp
index 7619f71d..4c896dbf 100644
--- a/common/trace_api.hpp
+++ b/common/trace_api.hpp
@@ -44,10 +44,13 @@ enum API {
API_UNKNOWN = 0,
API_GL, // GL + GLX/WGL/CGL
API_EGL, // GL/GLES1/GLES2/VG + EGL
+ API_DX, // All DirectX
API_D3D7,
API_D3D8,
API_D3D9,
API_D3D10,
+ API_D3D10_1,
+ API_D3D11,
};
diff --git a/common/trace_parser.cpp b/common/trace_parser.cpp
index 11ec2294..0e4fba09 100644
--- a/common/trace_parser.cpp
+++ b/common/trace_parser.cpp
@@ -242,12 +242,16 @@ Parser::parse_function_sig(void) {
*/
if (api == API_UNKNOWN) {
const char *n = sig->name;
- if ((n[0] == 'g' && n[1] == 'l' && n[2] == 'X') || // glX
- (n[0] == 'w' && n[1] == 'g' && n[2] == 'l' && n[3] >= 'A' && n[3] <= 'Z') || // wgl[A-Z]
- (n[0] == 'C' && n[1] == 'G' && n[2] == 'L')) { // CGL
+ if ((n[0] == 'g' && n[1] == 'l' && n[2] == 'X') || // glX*
+ (n[0] == 'w' && n[1] == 'g' && n[2] == 'l' && n[3] >= 'A' && n[3] <= 'Z') || // wgl[A-Z]*
+ (n[0] == 'C' && n[1] == 'G' && n[2] == 'L')) { // CGL*
api = trace::API_GL;
- } else if (n[0] == 'e' && n[1] == 'g' && n[2] == 'l' && n[3] >= 'A' && n[3] <= 'Z') { // egl
+ } else if (n[0] == 'e' && n[1] == 'g' && n[2] == 'l' && n[3] >= 'A' && n[3] <= 'Z') { // egl[A-Z]*
api = trace::API_EGL;
+ } else if (n[0] == 'D' &&
+ ((n[1] == 'i' && n[2] == 'r' && n[3] == 'e' && n[4] == 'c' && n[5] == 't') || // Direct*
+ (n[1] == '3' && n[2] == 'D'))) { // D3D*
+ api = trace::API_DX;
} else {
/* TODO */
}
diff --git a/common/trace_tools_trace.cpp b/common/trace_tools_trace.cpp
index 36fe7354..ad355abc 100644
--- a/common/trace_tools_trace.cpp
+++ b/common/trace_tools_trace.cpp
@@ -129,6 +129,12 @@ traceProgram(API api,
case API_D3D10:
wrapperFilename = "d3d10.dll";
break;
+ case API_D3D10_1:
+ wrapperFilename = "d3d10_1.dll";
+ break;
+ case API_D3D11:
+ wrapperFilename = "d3d11.dll";
+ break;
#endif
default:
std::cerr << "error: unsupported API\n";
diff --git a/gui/retracer.cpp b/gui/retracer.cpp
index 983cd1a9..69dca6c6 100644
--- a/gui/retracer.cpp
+++ b/gui/retracer.cpp
@@ -229,11 +229,28 @@ void Retracer::run()
QString prog;
QStringList arguments;
- if (m_api == trace::API_GL) {
+ switch (m_api) {
+ case trace::API_GL:
prog = QLatin1String("glretrace");
- } else if (m_api == trace::API_EGL) {
+ break;
+ case trace::API_EGL:
prog = QLatin1String("eglretrace");
- } else {
+ break;
+ case trace::API_DX:
+ 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:
+#ifdef Q_OS_WIN
+ prog = QLatin1String("d3dretrace");
+#else
+ prog = QLatin1String("wine");
+ arguments << QLatin1String("d3dretrace.exe");
+#endif
+ break;
+ default:
emit finished(QLatin1String("Unsupported API"));
return;
}
diff --git a/gui/tracedialog.cpp b/gui/tracedialog.cpp
index 15067077..fcfdf466 100644
--- a/gui/tracedialog.cpp
+++ b/gui/tracedialog.cpp
@@ -15,6 +15,8 @@ TraceDialog::TraceDialog(QWidget *parent)
apiComboBox->addItem("D3D8");
apiComboBox->addItem("D3D9");
apiComboBox->addItem("D3D10");
+ apiComboBox->addItem("D3D10_1");
+ apiComboBox->addItem("D3D11");
#else
apiComboBox->addItem("EGL");
#endif