diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2015-12-16 17:47:28 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2015-12-17 08:24:23 -0700 |
| commit | a62a08041594c25c35ae9fedb321e1f6cc1fa378 (patch) | |
| tree | 0f1fb7b83918a8a2971fa23368f791c3d8dc8ca8 | |
| parent | 338db9da918a917478cd3a55d23fde38d8ebbcd8 (diff) | |
| download | usermoji-a62a08041594c25c35ae9fedb321e1f6cc1fa378.tar.xz | |
layers: Fix find-first-set bitscan util
On win32, was using leading-zero count instead of find-first-set.
Caused random failures on Windows release builds.
| -rw-r--r-- | layers/draw_state.cpp | 4 | ||||
| -rw-r--r-- | layers/vk_layer_utils.h | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 9b999b7e..812b8fc8 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -1306,13 +1306,9 @@ static VkBool32 verifyPipelineCreateState(layer_data* my_data, const VkDevice de { VkBool32 skipCall = VK_FALSE; -#if 0 - // TODO: This call is causing a crash on Windows Release builds running the cube demo with DrawState enabled - // Root cause and fix. if (!validate_pipeline_shaders(my_data, device, pPipeline)) { skipCall = VK_TRUE; } -#endif // VS is required if (!(pPipeline->active_shaders & VK_SHADER_STAGE_VERTEX_BIT)) { diff --git a/layers/vk_layer_utils.h b/layers/vk_layer_utils.h index a4520505..52a615f6 100644 --- a/layers/vk_layer_utils.h +++ b/layers/vk_layer_utils.h @@ -63,9 +63,13 @@ size_t vk_format_get_size(VkFormat format); static inline int u_ffs(int val) { #ifdef WIN32 - return __lzcnt(val) + 1; + unsigned long bit_pos = 0; + if (_BitScanReverse(&bit_pos, val) != 0) { + bit_pos += 1; + } + return bit_pos; #else - return ffs(val); + return ffs(val); #endif } |
