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

Method MovePresentedImage

layers/sync/sync_submit.cpp:165–174  ·  view source on GitHub ↗

We move from the presented images array 1) so we don't copy shared_ptr, and 2) to mark it acquired

Source from the content-addressed store, hash-verified

163
164// We move from the presented images array 1) so we don't copy shared_ptr, and 2) to mark it acquired
165PresentedImage SwapchainSubState::MovePresentedImage(uint32_t image_index) {
166 if (presented.size() <= image_index) presented.resize(image_index + 1);
167 PresentedImage ret_val = std::move(presented[image_index]);
168 if (ret_val.Invalid()) {
169 // If this is the first time the image has been acquired, then it's valid to have no present record, so we create one
170 // Note: It's also possible this is an invalid acquire... but that's CoreChecks/Parameter validation's job to report
171 ret_val = PresentedImage(base.shared_from_this(), image_index);
172 }
173 return ret_val;
174}
175
176void SwapchainSubState::GetPresentBatches(std::vector<BatchContextPtr>& batches) const {
177 for (const auto& presented_image : presented) {

Callers 1

Calls 5

PresentedImageClass · 0.85
sizeMethod · 0.45
resizeMethod · 0.45
InvalidMethod · 0.45
shared_from_thisMethod · 0.45

Tested by

no test coverage detected