@@ -25,7 +25,7 @@ performed.
2525
2626* Set the current workload to a new render pass with the passed metadata.
2727
28- ** RENDERPASS_CONTINUE (const json\* ):**
28+ ** RENDERPASS_RESUME (const json\* ):**
2929
3030* Update the current workload, which must be a render pass, with extra
3131 draw count metadata.
@@ -72,13 +72,70 @@ real applications.
7272The command stream for a secondary command buffer is inlined into the primary
7373command buffer during recording.
7474
75+ ### Recording sequence
76+
77+ When application records a new workload:
78+
79+ * A ` tagID ` is assigned and recorded using ` vkCmdMarkerBegin() ` label in the
80+ Vulkan command stream _ before_ the new workload is written to the command
81+ stream.
82+ * If workload is using indirect parameters, then a transfer job to copy
83+ indirect parameters into a layer-owned buffer is emitted _ before_ the new
84+ workload. No additional barrier is needed because application barriers must
85+ have already ensured that the indirect parameter buffer is valid.
86+ * A proxy workload object is created in the layer storing the assigned
87+ ` tagID ` and all settings that are known at command recording time.
88+ * A layer command stream command is recorded into the submit time stream
89+ indicating ` <TYPE>_BEGIN ` with a pointer to the proxy workload. Note that
90+ this JSON may be modified later for some workloads.
91+ * If workload is using indirect parameters, a layer command stream command is
92+ recorded into the resolve time stream, which will handle cleanup and
93+ emitting the ` submitID.tagID ` annex message for the indirect data.
94+ * If the command buffer is not ONE_TIME_SUBMIT, if any workload is using
95+ indirect parameters, or contains incomplete render passes, the command
96+ buffer is marked as needing a ` submitID ` wrapper.
97+ * The user command is written to the Vulkan command stream.
98+
99+ When application resumes a render pass workload:
100+
101+ * A ` tagID ` of zero is assigned, but not emitted to the command stream.
102+ * A layer command stream command is recorded into the submit time stream
103+ indicating ` <TYPE>_RESUME ` with a pointer to the proxy workload. Note that
104+ this JSON may be modified later for some workloads.
105+ * The user command is written to the Vulkan command stream.
106+
107+ When application ends a workload:
108+
109+ * For render pass workloads, any statistics accumulated since the last begin
110+ are rolled up into the proxy workload object.
111+ * For render pass workloads, the user command is written to the Vulkan
112+ command stream.
113+ * The command steam label scope is closed using ` vkCmdMarkerEnd() ` .
114+
75115## Layer command playback
76116
77117The persistent state for command playback belongs to the queues the command
78118buffers are submitted to. The command stream bytecode is run by a bytecode
79119interpreter associated with the state of the current queue, giving the
80120interpreter access to the current ` submitID ` and queue debug label stack.
81121
122+ ### Submitting sequence
123+
124+ For each command buffer in the user submit:
125+
126+ * If the command buffer needs a ` submitID ` we allocate a unique ` submitID ` and
127+ create two new command buffers that will wrap the user command buffer with an
128+ additional stack layer of debug label containing the ` s<ID> ` string. We will
129+ inject a layer command stream async command to handle freeing the command
130+ buffers.
131+ * The tool will process the submit-time layer commands, executing each command
132+ to either update some state or emit
133+ * If there are any async layer commands, either recorded in the command buffer
134+ or from the wrapping command buffers, we will need to add an async handler.
135+ This cannot safely use the user fence or depend on any user object lifetime,
136+ so we will add a layer-owned timeline semaphore to the submit which we can
137+ wait on to determine when it is safe trigger the async work.
138+
82139## Future: Async commands
83140
84141One of our longer-term goals is to be able to capture indirect parameters,
0 commit comments