Skip to content

Commit

Permalink
layers: Fix checking if event is in use
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg committed Jan 13, 2025
1 parent ea05bf7 commit 69b2888
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion layers/core_checks/cc_synchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<vvl::Event>(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());
}
Expand Down
15 changes: 0 additions & 15 deletions layers/state_tracker/cmd_buffer_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<vvl::Event>(event);
if (event_state) event_state->write_in_use++;
}
}

// Discussed in details in https://github.com/KhronosGroup/Vulkan-Docs/issues/1081
Expand Down Expand Up @@ -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<bool(const QueryObject &)> &is_query_updated_after) {
// First perform decrement on general case bound objects
for (auto event : writeEventsBeforeWait) {
auto event_state = dev_data.Get<vvl::Event>(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) {
Expand Down
2 changes: 0 additions & 2 deletions layers/state_tracker/cmd_buffer_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 69b2888

Please sign in to comment.