Represents a command buffer, which is used to hold commands to be executed by a Vulkan queue.
More...
Go to the source code of this file.
|
| void | vulkan_command_buffer_allocate (vulkan_context *context, VkCommandPool pool, b8 is_primary, const char *name, vulkan_command_buffer *out_command_buffer, u32 secondary_buffer_count) |
| | Allocates a new command buffer from the given pool. More...
|
| |
| void | vulkan_command_buffer_free (vulkan_context *context, VkCommandPool pool, vulkan_command_buffer *command_buffer) |
| | Frees the given command buffer and returns it to the provided pool. More...
|
| |
| void | vulkan_command_buffer_begin (vulkan_context *context, vulkan_command_buffer *command_buffer, b8 is_single_use, b8 is_renderpass_continue, b8 is_simultaneous_use) |
| | Begins the provided command buffer. More...
|
| |
| void | vulkan_command_buffer_end (vulkan_context *context, vulkan_command_buffer *command_buffer) |
| | Ends the given command buffer. More...
|
| |
| b8 | vulkan_command_buffer_submit (vulkan_context *context, vulkan_command_buffer *command_buffer, VkQueue queue, u32 signal_semaphore_count, VkSemaphore *signal_semaphores, u32 wait_semaphore_count, VkSemaphore *wait_semaphores, VkFence fence) |
| | Sets the command buffer to the submitted state. More...
|
| |
| void | vulkan_command_buffer_execute_secondary (vulkan_context *context, vulkan_command_buffer *secondary) |
| | Executes commands in the given secondary command buffer. More...
|
| |
| void | vulkan_command_buffer_reset (vulkan_command_buffer *command_buffer) |
| | Resets the command buffer to the ready state. More...
|
| |
| void | vulkan_command_buffer_allocate_and_begin_single_use (vulkan_context *context, VkCommandPool pool, vulkan_command_buffer *out_command_buffer) |
| | Allocates and begins recording to out_command_buffer. More...
|
| |
| void | vulkan_command_buffer_end_single_use (vulkan_context *context, VkCommandPool pool, vulkan_command_buffer *command_buffer, VkQueue queue) |
| | Ends recording, submits to and waits for queue operation and frees the provided command buffer. More...
|
| |
Represents a command buffer, which is used to hold commands to be executed by a Vulkan queue.
- Author
- Travis Vroman (travi.nosp@m.s@ko.nosp@m.hieng.nosp@m.ine..nosp@m.com)
- Version
- 1.0
- Date
- 2022-01-11
- Copyright
- Kohi Game Engine is Copyright (c) Travis Vroman 2021-2022
◆ vulkan_command_buffer_allocate()
Allocates a new command buffer from the given pool.
- Parameters
-
| context | A pointer to the Vulkan context. |
| pool | The pool to allocate a command buffer from. |
| is_primary | Indicates if the command buffer is a primary or secondary buffer. |
| name | The name of the command buffer, for debugging purposes. |
| out_command_buffer | A pointer to hold the newly allocated command buffer. |
| secondary_buffer_count | The number of secondary buffers to create. 0 means create none. |
◆ vulkan_command_buffer_allocate_and_begin_single_use()
Allocates and begins recording to out_command_buffer.
- Parameters
-
| context | A pointer to the Vulkan context. |
| pool | The pool to obtain a command buffer from. |
| out_command_buffer | A pointer to hold the allocated command buffer. |
◆ vulkan_command_buffer_begin()
Begins the provided command buffer.
- Parameters
-
| context | A pointer to the Vulkan context. |
| command_buffer | A pointer to the command buffer to begin. |
| is_single_use | Indicates if the buffer is just single use. |
| is_renderpass_continue | Indicates if the buffer is renderpass continue. |
| is_simultaneous_use | Indicates if the buffer is simultaneous use. |
◆ vulkan_command_buffer_end()
Ends the given command buffer.
- Parameters
-
| context | A pointer to the Vulkan context. |
| command_buffer | A pointer to the command buffer to end. |
◆ vulkan_command_buffer_end_single_use()
Ends recording, submits to and waits for queue operation and frees the provided command buffer.
- Parameters
-
| context | A pointer to the Vulkan context. |
| pool | The pool to return a command buffer to. |
| command_buffer | A pointer to the command buffer to be returned. |
| queue | The queue to submit to. |
◆ vulkan_command_buffer_execute_secondary()
Executes commands in the given secondary command buffer.
- Parameters
-
| context | A pointer to the Vulkan context. |
| secondary | A pointer to the secondary command buffer to execute commands within. |
◆ vulkan_command_buffer_free()
Frees the given command buffer and returns it to the provided pool.
- Parameters
-
| context | A pointer to the Vulkan context. |
| pool | The pool to return the command buffer to. |
| command_buffer | The command buffer to be returned. |
◆ vulkan_command_buffer_reset()
Resets the command buffer to the ready state.
- Parameters
-
| command_buffer | A pointer to the command buffer whose state should be set. |
◆ vulkan_command_buffer_submit()
| b8 vulkan_command_buffer_submit |
( |
vulkan_context * |
context, |
|
|
vulkan_command_buffer * |
command_buffer, |
|
|
VkQueue |
queue, |
|
|
u32 |
signal_semaphore_count, |
|
|
VkSemaphore * |
signal_semaphores, |
|
|
u32 |
wait_semaphore_count, |
|
|
VkSemaphore * |
wait_semaphores, |
|
|
VkFence |
fence |
|
) |
| |
Sets the command buffer to the submitted state.
- Parameters
-
| command_buffer | A pointer to the command buffer whose state to set. |
Submits the command buffer to the given queue for execution. Also sets the command buffer to the submitted state.
- Parameters
-
| context | A pointer to the Vulkan context. |
| command_buffer | A pointer to the command buffer to be submitted. |
| queue | The queue to submit to. |
| signal_semaphore_count | The number of semaphore(s) to be signaled when the queue is complete. |
| signal_semaphores | The semaphore(s) to be signaled when the queue is complete. |
| wait_semaphore_count | The number of semaphore(s) to wait on before the command buffer is executed. |
| wait_semaphores | The semaphore(s) to be waited on before the command buffer is executed. |
| fence | An optional handle to a fence to be signaled once all submitted command buffers have completed execution. |
- Returns
- b8 True on success; otherwise false.