diff options
Diffstat (limited to 'tools/render-test')
| -rw-r--r-- | tools/render-test/options.cpp | 4 | ||||
| -rw-r--r-- | tools/render-test/options.h | 1 | ||||
| -rw-r--r-- | tools/render-test/render-test-main.cpp | 17 |
3 files changed, 20 insertions, 2 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp index 9d5ff35c8..2277a6ad7 100644 --- a/tools/render-test/options.cpp +++ b/tools/render-test/options.cpp @@ -151,6 +151,10 @@ SlangResult parseOptions(int argc, const char*const* argv, Slang::WriterHelper s { gOptions.useDXIL = true; } + else if (strcmp(arg, "-only-startup") == 0) + { + gOptions.onlyStartup = true; + } else if (strcmp(arg, "-adapter") == 0) { if (argCursor == argEnd) diff --git a/tools/render-test/options.h b/tools/render-test/options.h index 104906f42..0214c66e7 100644 --- a/tools/render-test/options.h +++ b/tools/render-test/options.h @@ -55,6 +55,7 @@ struct Options int slangArgCount = 0; bool useDXIL = false; + bool onlyStartup = false; Slang::List<Slang::String> renderFeatures; /// Required render features for this test to run diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 2bc6cd8f8..34e041473 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -555,6 +555,7 @@ SLANG_TEST_TOOL_API SlangResult innerMain(Slang::StdWriters* stdWriters, SlangSe return SLANG_FAIL; } + StringBuilder rendererName; rendererName << "[" << RendererUtil::toText(gOptions.rendererType) << "] "; if (gOptions.adapter.Length()) @@ -565,7 +566,10 @@ SLANG_TEST_TOOL_API SlangResult innerMain(Slang::StdWriters* stdWriters, SlangSe if (!renderer) { - fprintf(stderr, "Unable to create renderer %s\n", rendererName.Buffer()); + if (!gOptions.onlyStartup) + { + fprintf(stderr, "Unable to create renderer %s\n", rendererName.Buffer()); + } return SLANG_FAIL; } @@ -578,11 +582,20 @@ SLANG_TEST_TOOL_API SlangResult innerMain(Slang::StdWriters* stdWriters, SlangSe SlangResult res = renderer->initialize(desc, (HWND)window->getHandle()); if (SLANG_FAILED(res)) { - fprintf(stderr, "Unable to initialize renderer %s\n", rendererName.Buffer()); + if (!gOptions.onlyStartup) + { + fprintf(stderr, "Unable to initialize renderer %s\n", rendererName.Buffer()); + } return res; } } + // If the only test is we can startup, then we are done + if (gOptions.onlyStartup) + { + return SLANG_OK; + } + { for (const auto& feature : gOptions.renderFeatures) { |
