From 8c475bc0ac1a758bb67907a5ca0f3b475bce3e48 Mon Sep 17 00:00:00 2001 From: Mike Stroyan Date: Mon, 1 May 2017 11:10:07 -0600 Subject: layers: Special case threading and VK_NULL_HANDLE If a parameter is VK_NULL_HANDLE, then it needs no use count. Fixes #1712 --- layers/threading.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 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 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 lock(counter_lock); @@ -193,6 +202,9 @@ class counter { } } void finishRead(T object) { + if (object == VK_NULL_HANDLE) { + return; + } std::unique_lock lock(counter_lock); uses[object].reader_count -= 1; if ((uses[object].reader_count == 0) && (uses[object].writer_count == 0)) { -- cgit v1.2.3