diff options
| author | Mike Stroyan <stroyan@google.com> | 2017-05-01 11:10:07 -0600 |
|---|---|---|
| committer | Mike Stroyan <stroyan@users.noreply.github.com> | 2017-05-03 08:55:08 -0600 |
| commit | 8c475bc0ac1a758bb67907a5ca0f3b475bce3e48 (patch) | |
| tree | 8dcb15cbb5b51c8f449195c15b78a1d111bee543 /layers | |
| parent | 617a4a9f361d1f80d0fc53b91332dcb8b0af311b (diff) | |
| download | usermoji-8c475bc0ac1a758bb67907a5ca0f3b475bce3e48.tar.xz | |
layers: Special case threading and VK_NULL_HANDLE
If a parameter is VK_NULL_HANDLE, then it needs no use count.
Fixes #1712
Diffstat (limited to 'layers')
| -rw-r--r-- | layers/threading.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layers/threading.h b/layers/threading.h index 426f6c10..20d02976 100644 --- a/layers/threading.h +++ b/layers/threading.h @@ -77,6 +77,9 @@ class counter { std::mutex counter_lock; std::condition_variable counter_condition; void startWrite(debug_report_data *report_data, T object) { + if (object == VK_NULL_HANDLE) { + return; + } bool skipCall = false; loader_platform_thread_id tid = loader_platform_get_thread_id(); std::unique_lock<std::mutex> lock(counter_lock); @@ -147,6 +150,9 @@ class counter { } void finishWrite(T object) { + if (object == VK_NULL_HANDLE) { + return; + } // Object is no longer in use std::unique_lock<std::mutex> lock(counter_lock); uses[object].writer_count -= 1; @@ -159,6 +165,9 @@ class counter { } void startRead(debug_report_data *report_data, T object) { + if (object == VK_NULL_HANDLE) { + return; + } bool skipCall = false; loader_platform_thread_id tid = loader_platform_get_thread_id(); std::unique_lock<std::mutex> lock(counter_lock); @@ -193,6 +202,9 @@ class counter { } } void finishRead(T object) { + if (object == VK_NULL_HANDLE) { + return; + } std::unique_lock<std::mutex> lock(counter_lock); uses[object].reader_count -= 1; if ((uses[object].reader_count == 0) && (uses[object].writer_count == 0)) { |
