Skip to content

Commit fde6714

Browse files
committed
Improvements
1 parent 5ec1b5a commit fde6714

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

07_StagingAndMultipleQueues/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,15 +442,14 @@ class StagingAndMultipleQueuesApp final : public application_templates::BasicMul
442442
IQueue::SSubmitInfo submitInfo[1];
443443
IQueue::SSubmitInfo::SCommandBufferInfo cmdBuffSubmitInfo[] = { {cmdBuff.get()} };
444444
IQueue::SSubmitInfo::SSemaphoreInfo signalSemaphoreSubmitInfo[] = { {.semaphore = m_imagesProcessedSemaphore.get(), .value = imageToProcessId+1, .stageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT } };
445-
auto a = m_histogramSavedSemaphore->getCounterValue();
446-
const uint64_t histogramSaveWaitSemaphoreValue = imageToProcessId >= FRAMES_IN_FLIGHT ? imageToProcessId + 1 - FRAMES_IN_FLIGHT : 0;
445+
const uint64_t histogramSaveWaitSemaphoreValue = imageToProcessId + 1 - FRAMES_IN_FLIGHT;
447446
IQueue::SSubmitInfo::SSemaphoreInfo waitSemaphoreSubmitInfo[] = {
448447
{.semaphore = m_imagesLoadedSemaphore.get(), .value = imageToProcessId + 1, .stageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT},
449448
{.semaphore = m_histogramSavedSemaphore.get(), .value = histogramSaveWaitSemaphoreValue, .stageMask = PIPELINE_STAGE_FLAGS::COMPUTE_SHADER_BIT}
450449
};
451450
submitInfo[0].commandBuffers = cmdBuffSubmitInfo;
452451
submitInfo[0].signalSemaphores = signalSemaphoreSubmitInfo;
453-
submitInfo[0].waitSemaphores = waitSemaphoreSubmitInfo;
452+
submitInfo[0].waitSemaphores = {waitSemaphoreSubmitInfo, imageToProcessId < FRAMES_IN_FLIGHT ? 1u : 2u};
454453
computeQueue->submit(submitInfo);
455454
computeQueue->endCapture();
456455
std::string msg = std::string("Image nr ") + std::to_string(imageToProcessId) + " processed. Resource idx: " + std::to_string(resourceIdx);

0 commit comments

Comments
 (0)