Skip to content

Commit

Permalink
layers: Hack to not have piglet exit() destroy maps under us
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Oct 2, 2024
1 parent ef416aa commit b94dfe9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions layers/core_checks/cc_synchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,21 @@ bool CoreChecks::ValidateRenderPassPipelineBarriers(const Location &outer_loc, c
return skip;
}

class DummyObject {
public:
DummyObject() {};
~DummyObject() {
auto it = layer_data_map.begin(); // gets instance object
++it; // gets device object
it->second->ReleaseDeviceDispatchObject(LayerObjectTypeCoreValidation);
printf("Program called exit() and need to cleanup the layers prior to any atexit() calls trying to use cleared out std::map\n");
fflush(stdout);
}
};

bool CoreChecks::ValidateStageMasksAgainstQueueCapabilities(const LogObjectList &objlist, const Location &stage_mask_loc,
VkQueueFlags queue_flags, VkPipelineStageFlags2KHR stage_mask) const {
static const DummyObject dumm_object;
bool skip = false;
// these are always allowed by queues, calls that restrict them have dedicated VUs.
stage_mask &= ~(VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR | VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR |
Expand Down

0 comments on commit b94dfe9

Please sign in to comment.