285{
287 return nullptr;
288 }
289
290 std::unique_ptr<PendingRead> result;
292 [
kind](std::unique_ptr<PendingRead>& pending) {
295 return !pending->mesh;
297 return pending->layout.has_value();
299 return pending->mesh.has_value() || pending->triangle_soup;
301 return pending->image.has_value();
302 }
303 return false;
304 },
305 [this, &result](std::unique_ptr<PendingRead>& pending) {
306 if (pending->transfer) {
308 pending->transfer,
310 pending->bytes.data(),
311 pending->bytes.size(),
313 }
314 result = std::move(pending);
315 });
316 if (result) {
319 }
320 return result;
321}
std::atomic< bool > m_result_ready
std::atomic< bool > m_result_occupied
Memory::SweepList< std::unique_ptr< PendingRead > > m_result
std::shared_ptr< VKBuffer > m_staging
VKBufferResources::GenerationSlot generation_slot(const Portal::Graphics::GpuBufferHandle &handle)
Express a buffer handle as the slot the back_buffers transfer helpers take.
void resolve_back_buffer_read(TransferHandle &handle, const VKBufferResources::GenerationSlot &slot, void *data, size_t size, std::shared_ptr< VKBuffer > &staging, size_t staging_offset)
Wait for a recorded download, then copy it out of staging.