diff --git a/layers/core_checks/cc_synchronization.cpp b/layers/core_checks/cc_synchronization.cpp index 8371e34cfa4..d9cb2b85034 100644 --- a/layers/core_checks/cc_synchronization.cpp +++ b/layers/core_checks/cc_synchronization.cpp @@ -1407,7 +1407,7 @@ void CoreChecks::PreCallRecordCmdPipelineBarrier2(VkCommandBuffer commandBuffer, bool CoreChecks::PreCallValidateSetEvent(VkDevice device, VkEvent event, const ErrorObject &error_obj) const { bool skip = false; if (auto event_state = Get(event)) { - if (event_state->write_in_use) { + if (event_state->InUse()) { skip |= LogError("VUID-vkSetEvent-event-09543", event, error_obj.location.dot(Field::event), "(%s) that is already in use by a command buffer.", FormatHandle(event).c_str()); } diff --git a/layers/state_tracker/cmd_buffer_state.cpp b/layers/state_tracker/cmd_buffer_state.cpp index 3694500e366..ab0037d2496 100644 --- a/layers/state_tracker/cmd_buffer_state.cpp +++ b/layers/state_tracker/cmd_buffer_state.cpp @@ -327,14 +327,6 @@ void CommandBuffer::Reset(const Location &loc) { // Track which resources are in-flight by atomically incrementing their "in_use" count void CommandBuffer::IncrementResources() { submitCount++; - - // TODO : We should be able to remove the NULL look-up checks from the code below as long as - // all the corresponding cases are verified to cause CB_INVALID state and the CB_INVALID state - // should then be flagged prior to calling this function - for (auto event : writeEventsBeforeWait) { - auto event_state = dev_data.Get(event); - if (event_state) event_state->write_in_use++; - } } // Discussed in details in https://github.com/KhronosGroup/Vulkan-Docs/issues/1081 @@ -1656,13 +1648,6 @@ void CommandBuffer::Submit(VkQueue queue, uint32_t perf_submit_pass, const Locat } void CommandBuffer::Retire(uint32_t perf_submit_pass, const std::function &is_query_updated_after) { - // First perform decrement on general case bound objects - for (auto event : writeEventsBeforeWait) { - auto event_state = dev_data.Get(event); - if (event_state) { - event_state->write_in_use--; - } - } QueryMap local_query_to_state_map; VkQueryPool first_pool = VK_NULL_HANDLE; for (auto &function : query_updates) { diff --git a/layers/state_tracker/cmd_buffer_state.h b/layers/state_tracker/cmd_buffer_state.h index a20f70a21ee..6f5776e4a00 100644 --- a/layers/state_tracker/cmd_buffer_state.h +++ b/layers/state_tracker/cmd_buffer_state.h @@ -113,8 +113,6 @@ class Event : public StateObject { const bool metal_event_export; #endif // VK_USE_PLATFORM_METAL_EXT - int write_in_use = 0; - // Signaling state. // Gets updated at queue submission granularity or when signaled from the host. bool signaled = false;