MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / DetectFirstUseHazard

Method DetectFirstUseHazard

layers/sync/sync_op.cpp:1256–1273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254}
1255
1256bool ReplayState::DetectFirstUseHazard(const ResourceUsageRange& first_use_range) const {
1257 bool skip = false;
1258 if (first_use_range.non_empty()) {
1259 // We're allowing for the Replay(Validate|Record) to modify the exec_context (e.g. for Renderpass operations), so
1260 // we need to fetch the current access context each time
1261 const AccessContext* access_context = GetRecordedAccessContext();
1262
1263 const HazardResult hazard = access_context->DetectFirstUseHazard(exec_context_.GetQueueId(), first_use_range,
1264 exec_context_.GetCurrentAccessContext());
1265 if (hazard.IsHazard()) {
1266 const SyncValidator& sync_state = exec_context_.GetSyncState();
1267 LogObjectList objlist(exec_context_.Handle(), recorded_context_.Handle());
1268 const std::string error = sync_state.error_messages_.FirstUseError(hazard, exec_context_, recorded_context_, index_);
1269 skip |= sync_state.SyncError(hazard.Hazard(), objlist, error_obj_.location, error);
1270 }
1271 }
1272 return skip;
1273}
1274
1275bool ReplayState::ValidateFirstUse() {
1276 bool skip = false;

Callers 1

ReplayValidateMethod · 0.45

Calls 7

non_emptyMethod · 0.80
IsHazardMethod · 0.80
FirstUseErrorMethod · 0.80
SyncErrorMethod · 0.80
HazardMethod · 0.80
GetQueueIdMethod · 0.45
HandleMethod · 0.45

Tested by

no test coverage detected