Fix potential resource dependency problem. (#1079)
This commit is contained in:
parent
59b7217cbc
commit
bd7fd79bb8
1 changed files with 4 additions and 4 deletions
|
|
@ -562,7 +562,7 @@ public:
|
|||
VK_CHECK_RESULT(vkAllocateCommandBuffers(device, &cmdBufAllocateInfo, &compute.commandBuffer));
|
||||
|
||||
// Fence for compute CB sync
|
||||
VkFenceCreateInfo fenceCreateInfo = vks::initializers::fenceCreateInfo(VK_FENCE_CREATE_SIGNALED_BIT);
|
||||
VkFenceCreateInfo fenceCreateInfo = vks::initializers::fenceCreateInfo();
|
||||
VK_CHECK_RESULT(vkCreateFence(device, &fenceCreateInfo, nullptr, &compute.fence));
|
||||
|
||||
// Build a single command buffer containing the compute dispatch commands
|
||||
|
|
@ -604,15 +604,15 @@ public:
|
|||
{
|
||||
// Submit compute commands
|
||||
// Use a fence to ensure that compute command buffer has finished executing before using it again
|
||||
vkWaitForFences(device, 1, &compute.fence, VK_TRUE, UINT64_MAX);
|
||||
vkResetFences(device, 1, &compute.fence);
|
||||
|
||||
VkSubmitInfo computeSubmitInfo = vks::initializers::submitInfo();
|
||||
computeSubmitInfo.commandBufferCount = 1;
|
||||
computeSubmitInfo.pCommandBuffers = &compute.commandBuffer;
|
||||
|
||||
VK_CHECK_RESULT(vkQueueSubmit(compute.queue, 1, &computeSubmitInfo, compute.fence));
|
||||
|
||||
vkWaitForFences(device, 1, &compute.fence, VK_TRUE, UINT64_MAX);
|
||||
vkResetFences(device, 1, &compute.fence);
|
||||
|
||||
VulkanExampleBase::prepareFrame();
|
||||
|
||||
// Command buffer to be submitted to the queue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue