Jump to content
  • Advertisement

Vulkan Running GPU, CPU in parallel in Vulkan, DX12

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
  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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!