diff options
Diffstat (limited to 'tools/render-test')
| -rw-r--r-- | tools/render-test/options.cpp | 21 | ||||
| -rw-r--r-- | tools/render-test/options.h | 2 | ||||
| -rw-r--r-- | tools/render-test/render-test-main.cpp | 11 |
3 files changed, 34 insertions, 0 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp index b6208c4b3..1171a2a03 100644 --- a/tools/render-test/options.cpp +++ b/tools/render-test/options.cpp @@ -9,7 +9,11 @@ #include "../../source/core/slang-writer.h" #include "../../source/core/slang-render-api-util.h" +#include "../../source/core/list.h" +#include "../../source/core/slang-string-util.h" + namespace renderer_test { +using namespace Slang; static const Options gDefaultOptions; @@ -98,6 +102,23 @@ SlangResult parseOptions(int argc, const char*const* argv, Slang::WriterHelper s } gOptions.profileName = *argCursor++; } + else if (strcmp(arg, "-render-features") == 0 || strcmp(arg, "-render-feature") == 0) + { + if (argCursor == argEnd) + { + stdError.print("expected argument for '%s' option\n", arg); + return SLANG_FAIL; + } + const char* value = *argCursor++; + + List<UnownedStringSlice> values; + StringUtil::split(UnownedStringSlice(value), ',', values); + + for (const auto& value : values) + { + gOptions.renderFeatures.Add(value); + } + } else if( strcmp(arg, "-xslang") == 0 ) { // This is an option that we want to pass along to Slang diff --git a/tools/render-test/options.h b/tools/render-test/options.h index 6c1482ab4..7b55b9ac0 100644 --- a/tools/render-test/options.h +++ b/tools/render-test/options.h @@ -55,6 +55,8 @@ struct Options int slangArgCount = 0; bool useDXIL = false; + + Slang::List<Slang::String> renderFeatures; /// Required render features for this test to run }; extern Options gOptions; diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 0be84f52f..ee408f283 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -574,6 +574,17 @@ SLANG_TEST_TOOL_API SlangResult innerMain(Slang::StdWriters* stdWriters, SlangSe } } + { + for (const auto& feature : gOptions.renderFeatures) + { + // If doesn't have required feature... we have to give up + if (!renderer->hasFeature(feature.getUnownedSlice())) + { + return SLANG_E_NOT_AVAILABLE; + } + } + } + // Use the profile name set on options if set profileName = gOptions.profileName ? gOptions.profileName : profileName; |
