summaryrefslogtreecommitdiff
path: root/tools/slang-test/render-api-util.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-07-25 11:57:44 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2018-07-25 08:57:44 -0700
commitdff216cc5ddb073e5bffdd4550eda208b7527676 (patch)
tree938d28c2659765ef1d6e28acf58b77e8318974f8 /tools/slang-test/render-api-util.h
parent990ed7383ef1d3311dfc1023785d2dc18cca5171 (diff)
Improved command line control for apis and synthesized tests (#616)
* Parsing of control of api parameters no longer needs comma separator. Parsing of API list now can take an initial state. Document the command line option. * * Proper handling of 'default' (or initialFlags) - by using if the first token is an operator. * Clarified parsing of api flags. * Now 'vk' will mean just use vk. +vk will mean the defaults plus vk, and -vk is the defaults -vk. * Improve README.md on api expressions. Improve error text for failure to parse api expressions.
Diffstat (limited to 'tools/slang-test/render-api-util.h')
-rw-r--r--tools/slang-test/render-api-util.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/slang-test/render-api-util.h b/tools/slang-test/render-api-util.h
index a44528faf..1c3c81254 100644
--- a/tools/slang-test/render-api-util.h
+++ b/tools/slang-test/render-api-util.h
@@ -43,14 +43,16 @@ struct RenderApiUtil
/// Returns a combination of RenderApiFlag bits which if set indicates that the API is available.
static int getAvailableApis();
- /// Returns -1 if unknown
+ /// Returns RenderApiType::Unknown if not found
static RenderApiType findApiTypeByName(const Slang::UnownedStringSlice& name);
- /// Returns 0 if none found.
- static int findApiFlagsByName(const Slang::UnownedStringSlice& name);
+ /// FlagsOut will have flag/flags specified by a name if returns with successful result code.
+ static Slang::Result findApiFlagsByName(const Slang::UnownedStringSlice& name, RenderApiFlags* flagsOut);
- /// Parse api flags string (comma delimited list of api names, or 'all' for all)
- /// For example "all,-dx12" would be all apis, except dx12
- static Slang::Result parseApiFlags(const Slang::UnownedStringSlice& text, int* apiBitsOut);
+ /// Parse api flags string, returning SLANG_OK on success.
+ /// If first character is + or - the flags will be applied to initialFlags, else initialFlags is ignored.
+ /// For example "all-dx12" would be all apis, except dx12
+ /// -vk would be whatever is in initial flags, but not vulkan.
+ static Slang::Result parseApiFlags(const Slang::UnownedStringSlice& text, RenderApiFlags initialFlags, RenderApiFlags* apiBitsOut);
/// Get information about a render API
static const Info& getInfo(RenderApiType type) { return s_infos[int(type)]; }