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
Copy file name to clipboardExpand all lines: include/nbl/video/utilities/SIntendedSubmitInfo.h
+64-37Lines changed: 64 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,10 @@ namespace nbl::video
11
11
//! Struct meant to be used with any Utility (not just `IUtilities`) which exhibits "submit on overflow" behaviour.
12
12
//! Such functions are non-blocking (unless overflow) and take `SIntendedSubmitInfo` by reference and patch it accordingly.
13
13
//! for example: in the case the `waitSemaphores` were already waited upon, the struct will be modified to have it's `waitSemaphores` emptied.
14
-
//! MAKE SURE to do a submit to `queue` by yourself with the result of `popSubmit(...)` implicitly converted to `std::span<const IQueue::SSubmitInfo>` !
14
+
//! User is supposed to begin EXACTLY ONE of the `scratchCommandBuffer` before first ever submit.
15
+
//! Never `begin` or `end` scratch commandBuffers ever again.
16
+
//! Always assume the current recording commandBuffer is in RECORDING state (except between `submit` and `beginNextCommandBuffer` call intended for ADVANCED users)
17
+
//! The "current recording commandBuffer" is returned by `getCurrentRecordingCommandBufferInfo` or updated via the pointer ref in beginNextCommandBuffer or overflowSubmit)
15
18
structSIntendedSubmitInfofinal : core::Uncopyable
16
19
{
17
20
public:
@@ -27,14 +30,12 @@ struct SIntendedSubmitInfo final : core::Uncopyable
27
30
// EXACTLY ONE commandbuffer must be in recording state! This is the one the utility will use immediately to record commands.
28
31
// But remember that even though its scratch, you can record some of your own preceeding commands into it as well.
// This parameter is required but may be unused if there is no need (no overflow) to do submit.
31
-
// This semaphore is needed to "stitch together" additional submits if they occur so they occur before and after the original intended waits and signals.
33
+
// This semaphore is needed to ensure correct and valid usage of the command buffer used to record the next submit by ensuring they are not currently pending.
32
34
// The initial `scratchSemaphore.value` gets incremented and signalled on each submit, can start at 0 because an overflow will signal `value+1`.
33
-
// NOTE: You should signal this semaphore as well when doing your last/tail submit! Why?
34
-
// Utilities might use the `[Multi]TimelineEventHandler` to latch cleanups on `scratchSemaphore` where this value
35
+
// `[Multi]TimelineEventHandler` to latch cleanups on `scratchSemaphore` where this value, so make sure you're submitting by yourself manually and use the functions provided here.
35
36
// is a value that they expect to actually get signalled in the future.
36
-
// NOTE: Do not choose the values for waits and signals yourself, as the overflows may increment the counter by an arbitrary amount!
37
-
// You can actually examine the change in `scratchSemaphore.value` to figure out how many overflows occurred.
37
+
// NOTE: To ensure deterministic behavior, do not attempt to signal this semaphore yourself.
38
+
// You can actually examine the change in `scratchSemaphore.value` to figure out how many submits occurred.
// Optional: If you had a semaphore whose highest pending signal is 45 but gave the scratch a value of 68 (causing 69 to get signalled in a popped submit),
40
41
// but only used 4 scratch command buffers, we'd wait for the semaphore to reach 66 before resetting the next scratch command buffer.
@@ -48,22 +49,20 @@ struct SIntendedSubmitInfo final : core::Uncopyable
// Submits via the current recording command buffer
193
+
// ! recordingCmdBuf: current recording SCommandBufferInfo pointing to an element of `scratchCommandBuffers`.
194
+
// ! Optional: signalSemaphores: your signal semaphores that indicate the job is finished.
195
+
// ! Don't attempt to use the `recordingCmdBuf` after calling this function and before calling `beginNextCommandBuffer` because it will be in PENDING state
0 commit comments