| 1254 | } |
| 1255 | |
| 1256 | bool 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 | |
| 1275 | bool ReplayState::ValidateFirstUse() { |
| 1276 | bool skip = false; |
no test coverage detected