@@ -130,24 +130,36 @@ struct SIntendedSubmitInfo final : core::Uncopyable
130
130
131
131
// One thing you might notice is that this results in a few implicit Memory and Execution Dependencies
132
132
// So there's a little bit of non-deterministic behaviour we won't fight (will not insert a barrier every time you "could-have" overflown)
133
- inline void overflowSubmit ()
133
+ inline IQueue::RESULT overflowSubmit ()
134
134
{
135
135
auto cmdbuf = getScratchCommandBuffer ();
136
136
// first sumbit the already buffered up work
137
137
cmdbuf->end ();
138
+
138
139
// we only signal the scratch semaphore when overflowing
139
140
const auto submit = popSubmit ({});
140
- queue->submit (submit);
141
+ IQueue::RESULT res = queue->submit (submit);
142
+ if (res != IQueue::RESULT::SUCCESS)
143
+ return res;
144
+
141
145
// We wait (stall) on the immediately preceeding submission, this could be improved in the future with multiple buffering of the commandbuffers
142
146
{
143
147
const ISemaphore::SWaitInfo info = {.semaphore =scratchSemaphore.semaphore ,.value =scratchSemaphore.value };
144
- const_cast <ILogicalDevice*>(cmdbuf->getOriginDevice ())->blockForSemaphores ({&info,1 });
148
+ ISemaphore::WAIT_RESULT waitResult = const_cast <ILogicalDevice*>(cmdbuf->getOriginDevice ())->blockForSemaphores ({&info,1 });
149
+ if (waitResult != ISemaphore::WAIT_RESULT::SUCCESS)
150
+ {
151
+ assert (false );
152
+ return IQueue::RESULT::OTHER_ERROR;
153
+ }
145
154
}
146
155
// since all the commandbuffers have submitted already we only reuse the last one
147
156
commandBuffers = {&commandBuffers.back (),1 };
157
+
158
+
148
159
// we will still signal the same set in the future
149
160
cmdbuf->reset (IGPUCommandBuffer::RESET_FLAGS::RELEASE_RESOURCES_BIT);
150
161
cmdbuf->begin (IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT);
162
+ return res;
151
163
}
152
164
153
165
// Error Text to Log/Display if you try to use an invalid `SIntendedSubmitInfo`
0 commit comments