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

Method ValidateCountBuffer

layers/sync/sync_validation.cpp:1062–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1060}
1061
1062bool SyncValidator::ValidateCountBuffer(const CommandBufferAccessContext& cb_context, const AccessContext& context, VkBuffer buffer,
1063 VkDeviceSize offset, const Location& loc) const {
1064 bool skip = false;
1065
1066 auto count_buf_state = Get<vvl::Buffer>(buffer);
1067 const AccessRange range = MakeRange(offset, 4);
1068 auto hazard = context.DetectHazard(*count_buf_state, SYNC_DRAW_INDIRECT_INDIRECT_COMMAND_READ, range);
1069 if (hazard.IsHazard()) {
1070 const LogObjectList objlist(cb_context.GetCBState().Handle(), count_buf_state->Handle());
1071 const std::string resource_description = "draw count " + FormatHandle(buffer);
1072 const auto error = error_messages_.BufferError(hazard, cb_context, loc.function, resource_description, range);
1073 skip |= SyncError(hazard.Hazard(), objlist, loc, error);
1074 }
1075 return skip;
1076}
1077
1078void SyncValidator::RecordCountBuffer(CommandBufferAccessContext& cb_context, const ResourceUsageTag tag, VkBuffer buffer,
1079 VkDeviceSize offset) {

Callers

nothing calls this directly

Calls 6

IsHazardMethod · 0.80
BufferErrorMethod · 0.80
HazardMethod · 0.80
MakeRangeFunction · 0.70
DetectHazardMethod · 0.45
HandleMethod · 0.45

Tested by

no test coverage detected