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
//! Struct meant to be used with any utility (not just `IUtilities`) which exhibits "submit on overflow" behaviour.
212
+
//! Such functions are non-blocking (unless overflow) and take `SIntendedSubmitInfo` by reference and patch it accordingly.
213
+
//! MAKE SURE to do a submit to `queue` by yourself with a submit info obtained by casting `this` to `IQueue::SSubmitInfo` !
214
+
//! for example: in the case the `frontHalf.waitSemaphores` were already waited upon, the struct will be modified to have it's `waitSemaphores` emptied.
216
215
structSIntendedSubmitInfofinal
217
216
{
218
217
public:
219
218
inlineboolvalid() const
220
219
{
221
-
if (!queue || commandBuffers.empty() || signalSemaphores.empty())
220
+
if (!frontHalf.valid() || frontHalf.commandBuffers.empty() || signalSemaphores.empty())
222
221
returnfalse;
223
-
if (!getScratchCommandBuffer()->isResettable())
222
+
if (!frontHalf.getScratchCommandBuffer()->isResettable())
224
223
returnfalse;
225
-
if (!getScratchCommandBuffer()->getRecordingFlags().hasFlags(IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT))
226
-
returnfalse;
227
-
for (constauto& info : commandBuffers)
228
-
if (info.cmdbuf->getPool()->getQueueFamilyIndex()!=queue->getFamilyIndex())
224
+
if (!frontHalf.getScratchCommandBuffer()->getRecordingFlags().hasFlags(IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT))
229
225
returnfalse;
230
226
returntrue;
231
227
}
232
228
233
-
// Use the last command buffer in intendedNextSubmit, it should be in recording state
//! Copies `data` to stagingBuffer and Records the commands needed to copy the data from stagingBuffer to `bufferRange.buffer`
288
281
//! If the allocation from staging memory fails due to large buffer size or fragmentation then This function may need to submit the command buffer via the `submissionQueue`.
289
282
//! Returns:
290
-
//! IQueue::SSubmitInfo to use for command buffer submission instead of `intendedNextSubmit`.
291
-
//! for example: in the case the `SSubmitInfo::waitSemaphores` were already signalled, the new SSubmitInfo will have it's waitSemaphores emptied from `intendedNextSubmit`.
292
-
//! Make sure to submit with the new SSubmitInfo returned by this function
283
+
//! the number of times we overflown and had to submit, <0 [negative] on failure
293
284
//! Parameters:
285
+
//! - nextSubmit:
286
+
//! Is the SubmitInfo you intended to submit your command buffers with, it will be patched if overflow occurred @see SIntendedSubmitInfo
294
287
//! - bufferRange: contains offset + size into bufferRange::buffer that will be copied from `data` (offset doesn't affect how `data` is accessed)
295
288
//! - data: raw pointer to data that will be copied to bufferRange::buffer
296
-
//! - intendedNextSubmit:
297
-
//! Is the SubmitInfo you intended to submit your command buffers.
298
-
//! ** The last command buffer will be used to record the copy commands
299
289
//! - submissionQueue: IQueue used to submit, when needed.
300
290
//! Note: This parameter is required but may not be used if there is no need to submit
301
291
//! - scratchSemaphore:
@@ -320,24 +310,25 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
320
310
//! * submissionFence must point to a valid IGPUFence
321
311
//! * submissionFence must be in `UNSIGNALED` state
322
312
//! ** IUtility::getDefaultUpStreamingBuffer()->cull_frees() should be called before reseting the submissionFence and after fence is signaled.
if (!bufferRange.isValid() || !bufferRange.buffer->getCreationParams().usage.hasFlags(asset::IBuffer::EUF_TRANSFER_DST_BIT))
326
316
{
327
317
m_logger.log("Invalid `bufferRange` or buffer has no `EUF_TRANSFER_DST_BIT` usage flag, cannot `updateBufferRangeViaStagingBuffer`!", system::ILogger::ELL_ERROR);
0 commit comments