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
@@ -230,7 +298,10 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
230
298
//! ** The last command buffer will be used to record the copy commands
231
299
//! - submissionQueue: IQueue used to submit, when needed.
232
300
//! Note: This parameter is required but may not be used if there is no need to submit
233
-
//! - submissionFence:
301
+
//! - scratchSemaphore:
302
+
//! - since you've already decided on the semaphores you'll wait and signal in the `intendedNextSubmit`, we need an extra semaphore to "stich together" the submit if we split it
303
+
304
+
234
305
//! - This is the fence you will use to submit the copies to, this allows freeing up space in stagingBuffer when the fence is signalled, indicating that the copy has finished.
235
306
//! - This fence will be in `UNSIGNALED` state after exiting the function. (It will reset after each implicit submit)
236
307
//! - This fence may be used for CommandBuffer submissions using `submissionQueue` inside the function.
@@ -249,31 +320,26 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
249
320
//! * submissionFence must point to a valid IGPUFence
250
321
//! * submissionFence must be in `UNSIGNALED` state
251
322
//! ** IUtility::getDefaultUpStreamingBuffer()->cull_frees() should be called before reseting the submissionFence and after fence is signaled.
252
-
[[nodiscard("Use The New IQueue::SubmitInfo")]] inline IQueue::SSubmitInfo updateBufferRangeViaStagingBuffer(
if (!bufferRange.isValid() || !bufferRange.buffer->getCreationParams().usage.hasFlags(asset::IBuffer::EUF_TRANSFER_DST_BIT))
258
326
{
259
-
// TODO: log error -> intendedNextSubmit is invalid
260
-
assert(false);
261
-
return intendedNextSubmit;
327
+
m_logger.log("Invalid `bufferRange` or buffer has no `EUF_TRANSFER_DST_BIT` usage flag, cannot `updateBufferRangeViaStagingBuffer`!", system::ILogger::ELL_ERROR);
// some platforms expose non-coherent host-visible GPU memory, so writes need to be flushed explicitly
320
368
if (m_defaultUploadBuffer.get()->needsManualFlushOrInvalidate())
321
369
{
322
-
auto flushRange = AlignedMappedMemoryRange(m_defaultUploadBuffer.get()->getBuffer()->getBoundMemory(),localOffset,subSize,limits.nonCoherentAtomSize);
370
+
auto flushRange = AlignedMappedMemoryRange(m_defaultUploadBuffer.get()->getBuffer()->getBoundMemory().memory,localOffset,subSize,limits.nonCoherentAtomSize);
// this doesn't actually free the memory, the memory is queued up to be freed only after the GPU fence/event is signalled
332
-
m_defaultUploadBuffer.get()->multi_deallocate(1u,&localOffset,&allocationSize,core::smart_refctd_ptr<IGPUFence>(submissionFence),&cmdbuf); // can queue with a reset but not yet pending fence, just fine
379
+
// this doesn't actually free the memory, the memory is queued up to be freed only after the `scratchSemaphore` reaches a value a future submit will signal
0 commit comments