diff options
| author | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-10-21 17:08:06 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-10-23 17:32:04 -0600 |
| commit | 34d57d56eb667f2fe69a602d839074d1485c1931 (patch) | |
| tree | 083ddaed939f1ddbbf7f5b28c178b27ab38424a7 /layers/vk_layer_utils.h | |
| parent | 5104126379d2d4761c75866021e89172d38b34f6 (diff) | |
| download | usermoji-34d57d56eb667f2fe69a602d839074d1485c1931.tar.xz | |
WIP bug-14815: VkShaderStage
Diffstat (limited to 'layers/vk_layer_utils.h')
| -rw-r--r-- | layers/vk_layer_utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/layers/vk_layer_utils.h b/layers/vk_layer_utils.h index 643e1d25..bd5eac86 100644 --- a/layers/vk_layer_utils.h +++ b/layers/vk_layer_utils.h @@ -24,6 +24,9 @@ **************************************************************************/ #pragma once #include <stdbool.h> +#ifndef WIN32 +#include <strings.h> /* for ffs() */ +#endif #ifdef __cplusplus extern "C" { @@ -48,6 +51,14 @@ bool vk_format_is_srgb(VkFormat format); bool vk_format_is_compressed(VkFormat format); size_t vk_format_get_size(VkFormat format); +static inline int u_ffs(int val) +{ +#ifdef WIN32 + return __lzcnt(val) + 1; +#else + return ffs(val); +#endif +} #ifdef __cplusplus } |
