We move from the presented images array 1) so we don't copy shared_ptr, and 2) to mark it acquired
| 163 | |
| 164 | // We move from the presented images array 1) so we don't copy shared_ptr, and 2) to mark it acquired |
| 165 | PresentedImage 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 | |
| 176 | void SwapchainSubState::GetPresentBatches(std::vector<BatchContextPtr>& batches) const { |
| 177 | for (const auto& presented_image : presented) { |
no test coverage detected