Results 1 to 4 of 4

Thread: How do we know if a command buffer is being recorded or not?

  1. #1
    Newbie
    Join Date
    Nov 2017
    Posts
    2

    How do we know if a command buffer is being recorded or not?

    Also are we allowed to end the recording of a command buffer without having recorded any operations in it? Does the return value of
    Code :
    vkBeginCommandBuffer()
    indicate anything about the state of the command buffer? Thank you in advance.

  2. #2
    How do we know if a command buffer is being recorded or not?
    You created it and you either did or did not start recording into it. Vulkan is an API for grownups; it is up to you to keep track of the stuff that you yourself do.

    If your program's structure is not such that this information is obvious by its structure or contractually assumed, then you should keep track of it yourself. But it's better to structure your program so that the question never needs to be asked.

    Also are we allowed to end the recording of a command buffer without having recorded any operations in it?
    Is there a Valid Usage statement on `vkEndCommandBuffer` that would prevent it? If not, then you're allowed to do it.

    Does the return value of `vkBeginCommandBuffer` indicate anything about the state of the command buffer?
    What would it need to "indicate" "about the state of the command buffer"? Recording can either begin successfully or emit one of the error codes listed in the specification/documentation.

  3. #3
    Newbie
    Join Date
    Nov 2017
    Posts
    2
    Quote Originally Posted by Alfonse Reinheart View Post
    You created it and you either did or did not start recording into it. Vulkan is an API for grownups; it is up to you to keep track of the stuff that you yourself do.
    Yeah, I get that. I did take a look at the registry to see what it said about this as well. I only wanted to confirm that this was the case.

    If your program's structure is not such that this information is obvious by its structure or contractually assumed, then you should keep track of it yourself. But it's better to structure your program so that the question never needs to be asked.
    It is readily apparent in my code as to whether or not a command buffer is being recorded, so I don't think I will run into this problem.

    Thank you for the advice.

  4. #4
    Use the validation layers, if your command buffer isn't in an appropriate state when you manage it, they will notify you. Just make sure that in the "release" version of your program, every scenario that could end in a warning from those layers is avoided.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean