aboutsummaryrefslogtreecommitdiffstats
path: root/api-test/vk-command-buffer.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2022-10-27 23:22:55 +0200
committerladevieq <ladevie.quentin@gmail.com>2022-10-27 23:22:55 +0200
commitb47e177898657e435cb5bc913a4a783fddbe1f3d (patch)
treedf0a042b5ed9e98d7653462466dd3c6147127bc3 /api-test/vk-command-buffer.cpp
parentcee4f9c528a91691d94c52ec1849f3ad1245b081 (diff)
Api prototype
Diffstat (limited to 'api-test/vk-command-buffer.cpp')
-rw-r--r--api-test/vk-command-buffer.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/api-test/vk-command-buffer.cpp b/api-test/vk-command-buffer.cpp
new file mode 100644
index 0000000..b9eed19
--- /dev/null
+++ b/api-test/vk-command-buffer.cpp
@@ -0,0 +1,25 @@
+#include "vk-command-buffer.hpp"
+
+#include <cassert>
+
+#include "vulkan-loader.hpp"
+
+#ifdef _DEBUG
+#define VKCHECK(result) assert(result == VK_SUCCESS);
+#else
+#define VKCHECK(result) result;
+#endif
+
+void command_buffer::start() {
+ VkCommandBufferBeginInfo begin_info = {};
+ begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
+ begin_info.pNext = nullptr;
+ begin_info.flags = 0U;
+ begin_info.pInheritanceInfo = nullptr;
+
+ VKCHECK(vkBeginCommandBuffer(handle, &begin_info))
+}
+
+void command_buffer::stop() {
+ VKCHECK(vkEndCommandBuffer(handle))
+}