Jump to content
  • Advertisement
mark_braga

Vulkan Running GPU, CPU in parallel in Vulkan, DX12

This topic is 410 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am currently working on synchronization for frame submission in Vulkan.

This is currently the logic of the draw function.

void draw()
{
  uint32_t listIndex = gFrameCount++ % gSwapChainImageCount;
  Cmd* pCmd = ppCmds[listIndex];
  beginCmd(pCmd); // resets command buffer
  fillCommandList(pCmd);
  endCmd(pCmd);
  queueSubmit(pGraphicsQueue, pCmd);
}

gSwapChainImageCount is currently 3.

So there are no validation errors for first three frames but after I try to reset the command list in the fourth frame (listIndex is back to 0), I get a validation error

ERROR: [DS] : Attempt to reset command buffer (0x0000025AC56701B0) which is in use. The spec valid usage text states 'commandBuffer must not be in the pending state'

Now from what I read, submit will automatically stall after the third frame if swapChain[0] is still used. I have tried using all the present modes (Immediate, Fifo, Mailbox,...) but it gives the same error.

This leads me to believe that what I read was not correct. In that case, I would need to stall until that frame has been processed. So what would be the best way to determine if a commandBuffer is still in use in Vulkan?

Edited by mark_braga

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!