MCPcopy Create free account
hub / github.com/GPUOpen-Tools/GPU-Reshape / PopCommandBuffer

Method PopCommandBuffer

Source/Backends/Vulkan/Layer/Source/Queue.cpp:77–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77VkCommandBuffer QueueState::PopCommandBuffer() {
78 if (!commandBuffers.empty()) {
79 VkCommandBuffer cmd = commandBuffers.back();
80 commandBuffers.pop_back();
81 return cmd;
82 }
83
84 // Allocation info
85 VkCommandBufferAllocateInfo info{VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO};
86 info.commandPool = commandPool;
87 info.commandBufferCount = 1;
88 info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
89
90 // Attempt to allocate command buffer
91 VkCommandBuffer cmd{};
92 if (table->next_vkAllocateCommandBuffers(table->object, &info, &cmd) != VK_SUCCESS) {
93 return nullptr;
94 }
95
96 // Patch the dispatch table
97 PatchInternalTable(cmd, table->object);
98
99 // OK
100 return cmd;
101}
102
103void QueueState::PushCommandBuffer(VkCommandBuffer commandBuffer) {
104 commandBuffers.push_back(commandBuffer);

Callers 2

Calls 3

PatchInternalTableFunction · 0.85
pop_backMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected