summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorcheneym2 <acheney@nvidia.com>2025-02-19 09:08:57 -0500
committerGitHub <noreply@github.com>2025-02-19 14:08:57 +0000
commit0959d7ebeb6932b1949a4be10e5c472327006352 (patch)
tree851cc988f590c472954229824781cfe9519d0801 /tools/render-test
parent12d09b5a6cb9e921aace1bec484c76244e9afa94 (diff)
Show adapter info in slang-test (#6388)
When -show-adapter-info is provided to slang-test, there is a subsequent pass over all available APIs to ask render-api to show which adapter will be used. > .\slang-test.exe -show-adapter-info Supported backends: fxc dxc glslang spirv-dis clang visualstudio genericcpp nvrtc llvm spirv-opt tint Check vk,vulkan: Supported Check dx12,d3d12: Supported Check dx11,d3d11: Supported Check cuda: Supported Check wgpu,webgpu: Supported Adapter Information for Available APIs: vk,vulkan: Using graphics adapter: NVIDIA RTX A3000 Laptop GPU dx12,d3d12: Using graphics adapter: NVIDIA RTX A3000 Laptop GPU dx11,d3d11: Using graphics adapter: Intel(R) UHD Graphics cpu: cuda: wgpu,webgpu: Using graphics adapter: default passed test: 'tests/autodiff/arithmetic-jvp.slang (dx11)' ... closes #5600 * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/options.cpp4
-rw-r--r--tools/render-test/options.h2
-rw-r--r--tools/render-test/render-test-main.cpp8
3 files changed, 14 insertions, 0 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index 11b291c68..e0b38bf31 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -257,6 +257,10 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType)
{
outOptions.dx12Experimental = true;
}
+ else if (argValue == "-show-adapter-info")
+ {
+ outOptions.showAdapterInfo = true;
+ }
else
{
// Lookup
diff --git a/tools/render-test/options.h b/tools/render-test/options.h
index c95edee21..f041c3e84 100644
--- a/tools/render-test/options.h
+++ b/tools/render-test/options.h
@@ -91,6 +91,8 @@ struct Options
bool dx12Experimental = false;
+ bool showAdapterInfo = false;
+
Options() { downstreamArgs.addName("slang"); }
static SlangResult parse(
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index b0d6c44e0..d3d4a764c 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -1450,6 +1450,14 @@ static SlangResult _innerMain(
}
}
+ // Print adapter info after device creation but before any other operations
+ if (options.showAdapterInfo)
+ {
+ auto info = device->getDeviceInfo();
+ auto out = stdWriters->getOut();
+ out.print("Using graphics adapter: %s\n", info.adapterName);
+ }
+
// If the only test is we can startup, then we are done
if (options.onlyStartup)
{