diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2016-08-26 08:47:37 -0600 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2016-08-29 16:33:59 -0600 |
| commit | f68a5d8ec7fc061bd95d3b759658ef1b9d018173 (patch) | |
| tree | 36faadc956c98f31a4a631675f7a5750f46bcd62 | |
| parent | 0602f5597db6a738aeaa5f29049e1eadee9ad496 (diff) | |
| download | usermoji-f68a5d8ec7fc061bd95d3b759658ef1b9d018173.tar.xz | |
layers: Add white-list helper to layer utils
Change-Id: Idfc67481589ea9698ab82501889680044fcf8276
| -rw-r--r-- | layers/vk_layer_utils.cpp | 7 | ||||
| -rw-r--r-- | layers/vk_layer_utils.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/layers/vk_layer_utils.cpp b/layers/vk_layer_utils.cpp index 48b3f6e5..412a5a33 100644 --- a/layers/vk_layer_utils.cpp +++ b/layers/vk_layer_utils.cpp @@ -629,6 +629,13 @@ VkStringErrorFlags vk_string_validate(const int max_length, const char *utf8) { return result; } +// Utility function for finding a text string in another string +bool white_list(const char *item, const char *list) { + std::string candidate(item); + std::string white_list(list); + return (white_list.find(candidate) != std::string::npos); +} + // Debug callbacks get created in three ways: // o Application-defined debug callbacks // o Through settings in a vk_layer_settings.txt file diff --git a/layers/vk_layer_utils.h b/layers/vk_layer_utils.h index 7db58fca..623f0c59 100644 --- a/layers/vk_layer_utils.h +++ b/layers/vk_layer_utils.h @@ -116,6 +116,7 @@ unsigned int vk_format_get_channel_count(VkFormat format); VkFormatCompatibilityClass vk_format_get_compatibility_class(VkFormat format); VkDeviceSize vk_safe_modulo(VkDeviceSize dividend, VkDeviceSize divisor); VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array); +bool white_list(const char *item, const char *whitelist); static inline int u_ffs(int val) { #ifdef WIN32 |
