@@ -89,8 +89,8 @@ class StagingAndMultipleQueuesApp final : public application_templates::BasicMul
89
89
90
90
private:
91
91
smart_refctd_ptr<ISemaphore> m_imagesLoadedSemaphore, m_imagesProcessedSemaphore, m_histogramSavedSemaphore;
92
- std::atomic<uint32_t > m_imagesLoadedCnt, m_imagesProcessedCnt, m_imagesDownloadedCnt, m_imagesSavedCnt;
93
92
std::atomic<uint32_t > imageHandlesCreated = 0u ;
93
+ std::atomic<uint32_t > transfersSubmitted = 0u ;
94
94
std::array<core::smart_refctd_ptr<IGPUImage>, IMAGE_CNT> images;
95
95
96
96
static constexpr uint32_t FRAMES_IN_FLIGHT = 3u ;
@@ -243,6 +243,8 @@ class StagingAndMultipleQueuesApp final : public application_templates::BasicMul
243
243
};
244
244
transferUpQueue->startCapture ();
245
245
getTransferUpQueue ()->submit (intendedSubmit.popSubmit ({&signalSemaphore,1 }));
246
+ transfersSubmitted++;
247
+ transfersSubmitted.notify_one ();
246
248
transferUpQueue->endCapture ();
247
249
248
250
@@ -454,6 +456,12 @@ class StagingAndMultipleQueuesApp final : public application_templates::BasicMul
454
456
submitInfo[0 ].commandBuffers = cmdBuffSubmitInfo;
455
457
submitInfo[0 ].signalSemaphores = signalSemaphoreSubmitInfo;
456
458
submitInfo[0 ].waitSemaphores = {waitSemaphoreSubmitInfo, imageToProcessId < FRAMES_IN_FLIGHT ? 1u : 2u };
459
+ // Some Devices like all of the Intel GPUs do not have enough queues for us to allocate different queues to compute and transfers,
460
+ // so our `BasicMultiQueueApplication` will "alias" a single queue to both usages. Normally you don't need to care, but here we're
461
+ // attempting to do "out-of-order" "submit-before-signal" so we need to "hold back" submissions if the queues are aliased!
462
+ if (getTransferUpQueue ()==computeQueue)
463
+ for (auto old = transfersSubmitted.load (); old <= imageToProcessId; old = transfersSubmitted.load ())
464
+ transfersSubmitted.wait (old);
457
465
computeQueue->startCapture ();
458
466
computeQueue->submit (submitInfo);
459
467
computeQueue->endCapture ();
0 commit comments