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

Method OnBarrierCommand

layers/sync/sync_stats.cpp:140–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138void Stats::UpdateAccessStats(SyncValidator& validator) { access_stats.Update(validator); }
139
140void Stats::OnBarrierCommand(uint32_t memory_barrier_count, uint32_t buffer_barrier_count, uint32_t image_barrier_count,
141 uint32_t execution_dependencies_count) {
142 if (memory_barrier_count) {
143 barrier_stats.memory_barriers.Add(memory_barrier_count);
144 }
145 if (buffer_barrier_count) {
146 barrier_stats.buffer_barriers.Add(buffer_barrier_count);
147 }
148 if (image_barrier_count) {
149 barrier_stats.image_barriers.Add(image_barrier_count);
150 }
151 if (execution_dependencies_count) {
152 barrier_stats.execution_dependencies.Add(execution_dependencies_count);
153 }
154
155 const uint32_t command_total_barrier_count = memory_barrier_count + buffer_barrier_count + image_barrier_count;
156 if (command_total_barrier_count == 1) {
157 barrier_stats.single_barrier_commands.Add(1);
158 } else if (command_total_barrier_count > 1) {
159 barrier_stats.multi_barrier_commands.Add(1);
160 }
161
162 if (memory_barrier_count > 1 && buffer_barrier_count == 0 && image_barrier_count == 0) {
163 barrier_stats.multi_barrier_commands_only_memory.Add(1);
164 } else if (buffer_barrier_count > 1 && memory_barrier_count == 0 && image_barrier_count == 0) {
165 barrier_stats.multi_barrier_commands_only_buffer.Add(1);
166 } else if (image_barrier_count > 1 && memory_barrier_count == 0 && buffer_barrier_count == 0) {
167 barrier_stats.multi_barrier_commands_only_image.Add(1);
168 }
169}
170
171void Stats::UpdateMemoryStats() {
172#if defined(USE_MIMALLOC_STATS)

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected