summaryrefslogtreecommitdiffstats
path: root/tools/slang-test/render-api-util.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-03-07 16:31:56 -0500
committerGitHub <noreply@github.com>2019-03-07 16:31:56 -0500
commitf33aee2be9017934140da9fdfb0dcde15568b3a8 (patch)
tree15e0a6bdf137c103806269cdd2c490467560642c /tools/slang-test/render-api-util.h
parent3f6609a61465a09ad83ecbab5f59ec9475e5cc81 (diff)
Fix problems with synthesized tests and inconsitent render-test command lines (#885)
* * Check for inconsistent command line options for renderer * Moved RenderApiUtil into core so can be used in slang-test * Make it use the ShaderdLibrary for API testsing * Added some simplifying functions to StringUtil for spliting/comparisons * Refactored the synthesis of rendering tests so that inconsistent combinations are not produced * Add missing slang-render-api-util.cpp & .h * Stop warning on linux about _canLoadSharedLibrary not being used.
Diffstat (limited to 'tools/slang-test/render-api-util.h')
-rw-r--r--tools/slang-test/render-api-util.h64
1 files changed, 0 insertions, 64 deletions
diff --git a/tools/slang-test/render-api-util.h b/tools/slang-test/render-api-util.h
deleted file mode 100644
index 1c3c81254..000000000
--- a/tools/slang-test/render-api-util.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef SLANG_RENDER_API_UTIL_H
-#define SLANG_RENDER_API_UTIL_H
-
-#include "../../source/core/slang-string.h"
-
-#include "../../slang-com-helper.h"
-
-enum class RenderApiType
-{
- Unknown = -1,
- OpenGl = 0,
- Vulkan,
- D3D12,
- D3D11,
- CountOf,
-};
-
-// Use a struct wrapped Enum instead of enum class, cos we want to be able to manipulate as integrals
-struct RenderApiFlag
-{
- enum Enum
- {
- OpenGl = 1 << int(RenderApiType::OpenGl),
- Vulkan = 1 << int(RenderApiType::Vulkan),
- D3D12 = 1 << int(RenderApiType::D3D12),
- D3D11 = 1 << int(RenderApiType::D3D11),
- AllOf = (1 << int(RenderApiType::CountOf)) - 1 ///< All bits set
- };
-};
-typedef uint32_t RenderApiFlags;
-
-struct RenderApiUtil
-{
- struct Info
- {
- RenderApiType type; ///< The type
- const char* names; ///< Comma separated list of names associated with the type
- };
-
- /// Returns true if the API is available.
- static bool calcHasApi(RenderApiType type);
-
- /// Returns a combination of RenderApiFlag bits which if set indicates that the API is available.
- static int getAvailableApis();
-
- /// Returns RenderApiType::Unknown if not found
- static RenderApiType findApiTypeByName(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, 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)]; }
-
- /// Static information about each render api
- static const Info s_infos[int(RenderApiType::CountOf)];
-};
-
-#endif // SLANG_RENDER_API_UTIL_H \ No newline at end of file