rhi: vulkan: fix the pWaitDstStageMask parameter of vkQueueSubmit
It expects one mask per wait semaphore, where only one was given, leading to an out-of-bound read. Amends 202dd3cb39ab4408c44a8588b8d6fb9a1cc3a184. Fixes: QTBUG-132356 Pick-to: 6.9 Change-Id: I6f7d33eb4568d1577e09411f7be751c8dc520429 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
parent
6f9e40ad39
commit
ff68e05bc3
@ -2847,18 +2847,17 @@ QRhi::FrameOpResult QRhiVulkan::endAndSubmitPrimaryCommandBuffer(VkCommandBuffer
|
|||||||
if (signalSem)
|
if (signalSem)
|
||||||
signalSemaphoresForQueueSubmit.append(*signalSem);
|
signalSemaphoresForQueueSubmit.append(*signalSem);
|
||||||
|
|
||||||
|
submitInfo.waitSemaphoreCount = uint32_t(waitSemaphoresForQueueSubmit.count());
|
||||||
if (!waitSemaphoresForQueueSubmit.isEmpty()) {
|
if (!waitSemaphoresForQueueSubmit.isEmpty()) {
|
||||||
submitInfo.waitSemaphoreCount = uint32_t(waitSemaphoresForQueueSubmit.count());
|
|
||||||
submitInfo.pWaitSemaphores = waitSemaphoresForQueueSubmit.constData();
|
submitInfo.pWaitSemaphores = waitSemaphoresForQueueSubmit.constData();
|
||||||
|
semaphoresWaitMasksForQueueSubmit.resize(waitSemaphoresForQueueSubmit.count(), VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT);
|
||||||
|
submitInfo.pWaitDstStageMask = semaphoresWaitMasksForQueueSubmit.constData();
|
||||||
}
|
}
|
||||||
|
submitInfo.signalSemaphoreCount = uint32_t(signalSemaphoresForQueueSubmit.count());
|
||||||
if (!signalSemaphoresForQueueSubmit.isEmpty()) {
|
if (!signalSemaphoresForQueueSubmit.isEmpty()) {
|
||||||
submitInfo.signalSemaphoreCount = uint32_t(signalSemaphoresForQueueSubmit.count());
|
|
||||||
submitInfo.pSignalSemaphores = signalSemaphoresForQueueSubmit.constData();
|
submitInfo.pSignalSemaphores = signalSemaphoresForQueueSubmit.constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
VkPipelineStageFlags psf = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
|
||||||
submitInfo.pWaitDstStageMask = &psf;
|
|
||||||
|
|
||||||
err = df->vkQueueSubmit(gfxQueue, 1, &submitInfo, cmdFence);
|
err = df->vkQueueSubmit(gfxQueue, 1, &submitInfo, cmdFence);
|
||||||
|
|
||||||
waitSemaphoresForQueueSubmit.clear();
|
waitSemaphoresForQueueSubmit.clear();
|
||||||
|
@ -1089,6 +1089,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QVarLengthArray<VkSemaphore, 4> waitSemaphoresForQueueSubmit;
|
QVarLengthArray<VkSemaphore, 4> waitSemaphoresForQueueSubmit;
|
||||||
|
QVarLengthArray<VkPipelineStageFlags, 4> semaphoresWaitMasksForQueueSubmit;
|
||||||
QVarLengthArray<VkSemaphore, 4> signalSemaphoresForQueueSubmit;
|
QVarLengthArray<VkSemaphore, 4> signalSemaphoresForQueueSubmit;
|
||||||
QVarLengthArray<VkSemaphore, 4> waitSemaphoresForPresent;
|
QVarLengthArray<VkSemaphore, 4> waitSemaphoresForPresent;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user