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

Method Validate

layers/sync/sync_op.cpp:368–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366}
367
368bool SyncOpPipelineBarrier::Validate(const CommandBufferAccessContext& cb_context) const {
369 bool skip = false;
370 const AccessContext& context = cb_context.GetCurrentAccessContext();
371
372 // Validate Image Layout transitions
373 for (const auto& image_barrier : barrier_set_.image_barriers) {
374 if (!image_barrier.layout_transition) {
375 continue;
376 }
377 const vvl::Image& image_state = *image_barrier.image;
378 const bool can_transition_depth_slices =
379 CanTransitionDepthSlices(cb_context.GetSyncState().extensions, image_state.GetImageType(), image_state.create_flags);
380 const auto hazard = context.DetectImageBarrierHazard(
381 image_state, image_barrier.barrier.src_exec_scope.exec_scope, image_barrier.barrier.src_access_scope,
382 image_barrier.subresource_range, can_transition_depth_slices, AccessContext::kDetectAll);
383 if (hazard.IsHazard()) {
384 LogObjectList objlist(cb_context.GetCBState().Handle(), image_state.Handle());
385 const Location loc(command_);
386 const SyncValidator& sync_state = cb_context.GetSyncState();
387 const std::string resource_description = sync_state.FormatHandle(image_state.Handle());
388 const std::string error =
389 sync_state.error_messages_.ImageBarrierError(hazard, cb_context, command_, resource_description, image_barrier);
390 skip |= sync_state.SyncError(hazard.Hazard(), objlist, loc, error);
391 }
392 }
393 return skip;
394}
395
396ResourceUsageTag SyncOpPipelineBarrier::Record(CommandBufferAccessContext* cb_context) {
397 const auto tag = cb_context->NextCommandTag(command_);

Calls 15

CanTransitionDepthSlicesFunction · 0.85
IsHazardMethod · 0.80
ImageBarrierErrorMethod · 0.80
SyncErrorMethod · 0.80
HazardMethod · 0.80
LogInfoMethod · 0.80
InitFromMethod · 0.80
ValidateNextSubpassMethod · 0.80
ValidateEndRenderPassMethod · 0.80

Tested by

no test coverage detected