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

Method MakeMemoryBarriers

layers/sync/sync_op.cpp:203–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201using EventImageRangeGenerator = FilteredGeneratorGenerator<subresource_adapter::ImageRangeGenerator>;
202
203void BarrierSet::MakeMemoryBarriers(const SyncExecScope& src, const SyncExecScope& dst, uint32_t barrier_count,
204 const VkMemoryBarrier* barriers) {
205 memory_barriers.reserve(std::max<uint32_t>(1, barrier_count));
206 for (const VkMemoryBarrier& barrier : vvl::make_span(barriers, barrier_count)) {
207 SyncBarrier sync_barrier(src, barrier.srcAccessMask, dst, barrier.dstAccessMask);
208 memory_barriers.emplace_back(sync_barrier);
209 }
210
211 // Ensure we have a barrier that handles execution dependencies.
212 // NOTE: the reason to have execution barrier is explained in details in the comment for Sync2
213 // MakeMemoryBarriers overload. The Sync1 implementation is much simpler since execution scopes
214 // are the same for all barriers.
215 if (barrier_count == 0) {
216 memory_barriers.emplace_back(SyncBarrier(src, dst));
217 }
218 single_exec_scope = true;
219 execution_dependency_barrier_count = (barrier_count == 0) ? 1 : 0;
220}
221
222void BarrierSet::MakeMemoryBarriers(VkQueueFlags queue_flags, const VkDependencyInfo& dep_info) {
223 // Collect unique execution dependencies from buffer and image barriers.

Callers 2

SyncOpPipelineBarrierMethod · 0.80
SyncOpWaitEventsMethod · 0.80

Calls 6

make_spanFunction · 0.85
SyncBarrierClass · 0.85
emplace_backMethod · 0.80
reserveMethod · 0.45
ContainsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected