summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-09-11 11:09:05 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-09-12 14:28:23 +0000
commitef78a2e8f9bade867e43c75892353e38d48c595c (patch)
tree9d8fb1978ef71e70e095f22b4b8daf74b9e1b6c6 /tests
parent8fef0ffc16ec9a88169349adfa8aafc9f375e94b (diff)
rhi: Add a flag to indicate preferring a software adapter
...if there is one and the concept is applicable in the first place. Change-Id: Iab202c1c1cdd229f4910159de4cae7ce30805ea9 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/rhi/shared/examplefw.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/manual/rhi/shared/examplefw.h b/tests/manual/rhi/shared/examplefw.h
index 8afacc074a..4bd087473b 100644
--- a/tests/manual/rhi/shared/examplefw.h
+++ b/tests/manual/rhi/shared/examplefw.h
@@ -473,6 +473,10 @@ int main(int argc, char **argv)
"(generate a device reset every <count> frames when on D3D11)"),
QLatin1String("count"));
cmdLineParser.addOption(tdrOption);
+ // Allow testing preferring the software adapter (D3D).
+ QCommandLineOption swOption(QLatin1String("software"), QLatin1String("Prefer a software renderer when choosing the adapter. "
+ "Only applicable with some APIs and platforms."));
+ cmdLineParser.addOption(swOption);
cmdLineParser.process(app);
if (cmdLineParser.isSet(nullOption))
@@ -534,6 +538,9 @@ int main(int argc, char **argv)
if (cmdLineParser.isSet(tdrOption))
framesUntilTdr = cmdLineParser.value(tdrOption).toInt();
+ if (cmdLineParser.isSet(swOption))
+ rhiFlags |= QRhi::PreferSoftwareRenderer;
+
// Create and show the window.
Window w;
#if QT_CONFIG(vulkan)