Skip to content

Commit e2679fa

Browse files
MarijnS95claude
andauthored
Remove unused pWaitDstStageMask from Vulkan submit (#1034)
`pWaitDstStageMask` is only meaningful when wait semaphores are used, which this submit path does not use. This wasn't causing errors in practice because `vkWaitForFences()` is called after every submit, preventing concurrent in-flight command buffers. The compute dispatch submit passed `VK_PIPELINE_STAGE_TRANSFER_BIT`, intending to wait for the prior buffer transfer submit to complete, but `pWaitDstStageMask` is a **destination stage mask** — it specifies which stages in the current submit to block until a wait semaphore signals, **not** which prior stages to wait on. Without semaphores this had no effect. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 77bccdd commit e2679fa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/API/VK/Device.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,7 @@ class VulkanDevice : public offloadtest::Device {
11541154
return llvm::Error::success();
11551155
}
11561156

1157-
llvm::Error executeCommandBuffer(InvocationState &IS,
1158-
VkPipelineStageFlags WaitMask = 0) {
1157+
llvm::Error executeCommandBuffer(InvocationState &IS) {
11591158
if (vkEndCommandBuffer(IS.CmdBuffer))
11601159
return llvm::createStringError(std::errc::device_or_resource_busy,
11611160
"Could not end command buffer.");
@@ -1164,7 +1163,6 @@ class VulkanDevice : public offloadtest::Device {
11641163
SubmitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
11651164
SubmitInfo.commandBufferCount = 1;
11661165
SubmitInfo.pCommandBuffers = &IS.CmdBuffer;
1167-
SubmitInfo.pWaitDstStageMask = &WaitMask;
11681166
VkFenceCreateInfo FenceInfo = {};
11691167
FenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
11701168
VkFence Fence;
@@ -2365,7 +2363,7 @@ class VulkanDevice : public offloadtest::Device {
23652363
if (auto Err = createCommands(P, State))
23662364
return Err;
23672365
llvm::outs() << "Commands created.\n";
2368-
if (auto Err = executeCommandBuffer(State, VK_PIPELINE_STAGE_TRANSFER_BIT))
2366+
if (auto Err = executeCommandBuffer(State))
23692367
return Err;
23702368
llvm::outs() << "Executed compute command buffer.\n";
23712369
if (auto Err = readBackData(P, State))

0 commit comments

Comments
 (0)