Skip to content

Commit

Permalink
layers:Update shared_mutex check
Browse files Browse the repository at this point in the history
ANGLE build uses custom, older SDK that doesn't include shared_mutex
to modifying the shared_mutex preprocessor checks to account for this
config.
  • Loading branch information
tobine committed Aug 23, 2019
1 parent fd3bb24 commit e2a6c44
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion layers/generated/layer_chassis_dispatch.cpp
Expand Up @@ -31,7 +31,7 @@
#include "vk_safe_struct.cpp"

// shared_mutex support added in MSVC 2015 update 2
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && NTDDI_VERSION > NTDDI_WIN10_RS2
#include <shared_mutex>
typedef std::shared_mutex dispatch_lock_t;
typedef std::shared_lock<dispatch_lock_t> read_dispatch_lock_guard_t;
Expand Down
2 changes: 1 addition & 1 deletion layers/object_lifetime_validation.h
Expand Up @@ -21,7 +21,7 @@
*/

// shared_mutex support added in MSVC 2015 update 2
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && NTDDI_VERSION > NTDDI_WIN10_RS2
#include <shared_mutex>
typedef std::shared_mutex object_lifetime_mutex_t;
typedef std::shared_lock<object_lifetime_mutex_t> read_object_lifetime_mutex_t;
Expand Down
4 changes: 2 additions & 2 deletions layers/vk_layer_utils.h
Expand Up @@ -161,7 +161,7 @@ static inline int u_ffs(int val) {
#endif

// shared_mutex support added in MSVC 2015 update 2
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && NTDDI_VERSION > NTDDI_WIN10_RS2
#include <shared_mutex>
#endif

Expand Down Expand Up @@ -291,7 +291,7 @@ class vl_concurrent_unordered_map {
private:
static const int BUCKETS = (1 << BUCKETSLOG2);
// shared_mutex support added in MSVC 2015 update 2
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && NTDDI_VERSION > NTDDI_WIN10_RS2
#include <shared_mutex>
typedef std::shared_mutex lock_t;
typedef std::shared_lock<lock_t> read_lock_guard_t;
Expand Down
2 changes: 1 addition & 1 deletion layers/vk_mem_alloc.h
Expand Up @@ -3137,7 +3137,7 @@ the containers.

#ifndef VMA_USE_STL_SHARED_MUTEX
// Minimum Visual Studio 2015 Update 2
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && NTDDI_VERSION > NTDDI_WIN10_RS2
#define VMA_USE_STL_SHARED_MUTEX 1
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion scripts/layer_chassis_dispatch_generator.py
Expand Up @@ -1122,7 +1122,7 @@ def endFile(self):
write('#include "vk_safe_struct.cpp"', file=self.outFile)
self.newline()
write('// shared_mutex support added in MSVC 2015 update 2', file=self.outFile)
write('#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918', file=self.outFile)
write('#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 && NTDDI_VERSION > NTDDI_WIN10_RS2', file=self.outFile)
write(' #include <shared_mutex>', file=self.outFile)
write(' typedef std::shared_mutex dispatch_lock_t;', file=self.outFile)
write(' typedef std::shared_lock<dispatch_lock_t> read_dispatch_lock_guard_t;', file=self.outFile)
Expand Down

0 comments on commit e2a6c44

Please sign in to comment.