You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//! Calls the callback to copy the data to a destination Offset
407
-
//! * IMPORTANT: To make the copies ready, IUtility::getDefaultDownStreamingBuffer()->cull_frees() should be called after the `submissionFence` is signaled.
406
+
//! * IMPORTANT: To make all the callbacks execute, IUtility::getDefaultDownStreamingBuffer()->cull_frees() should be called after the `nextSubmit.signalSemaphores.front()` is signaled.
408
407
//! If the allocation from staging memory fails due to large image size or fragmentation then This function may need to submit the command buffer via the `submissionQueue` and then signal the fence.
409
408
//! Returns:
410
409
//! IQueue::SSubmitInfo to use for command buffer submission instead of `intendedNextSubmit`.
@@ -438,50 +437,44 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
438
437
//! * submissionQueue must point to a valid IQueue
439
438
//! * submissionFence must point to a valid IGPUFence
440
439
//! * submissionFence must be in `UNSIGNALED` state
441
-
[[nodiscard("Use The New IQueue::SubmitInfo")]] inline IQueue::SSubmitInfo downloadBufferRangeViaStagingBuffer(
if (!intendedNextSubmit.isValid() || intendedNextSubmit.commandBufferCount <= 0u)
442
+
if (!srcBufferRange.isValid() || !srcBufferRange.buffer->getCreationParams().usage.hasFlags(asset::IBuffer::EUF_TRANSFER_SRC_BIT))
447
443
{
448
-
// TODO: log error -> intendedNextSubmit is invalid
449
-
assert(false);
450
-
return intendedNextSubmit;
444
+
m_logger.log("Invalid `srcBufferRange` or buffer has no `EUF_TRANSFER_SRC_BIT` usage flag, cannot `downloadBufferRangeViaStagingBuffer`!",system::ILogger::ELL_ERROR);
445
+
returnfalse;
451
446
}
452
447
453
-
// Use the last command buffer in intendedNextSubmit, it should be in recording state
if (!autoSubmitAndBlock(submit,[&](SIntendedSubmitInfo& nextSubmit){returndownloadBufferRangeViaStagingBuffer(default_data_consumption_callback_t(data),nextSubmit,srcBufferRange);}))
502
+
returnfalse;
545
503
546
-
//! TODO: NOTE this method cannot be turned into a pure autoSubmitAndBlock + lambda because there's stuff to do AFTER the semaphore wait~!
547
-
m_defaultDownloadBuffer->cull_frees(); // its while(poll()) {} now IIRC
504
+
//! NOTE this method cannot be turned into a pure autoSubmitAndBlock + lambda because there's stuff to do AFTER the semaphore wait~!
0 commit comments