stop exposing a few functions
This commit is contained in:
parent
a55d67b9b5
commit
61308ed427
2 changed files with 12 additions and 18 deletions
|
@ -108,7 +108,7 @@ bool vk_transfer_vertex_data(void) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool vk_record_command_buffer(const VkCommandBuffer command_buffer, const uint32_t image_index) {
|
bool record_command_buffer(const VkCommandBuffer command_buffer, const uint32_t image_index) {
|
||||||
VK_TRY(false,
|
VK_TRY(false,
|
||||||
vkBeginCommandBuffer(
|
vkBeginCommandBuffer(
|
||||||
command_buffer,
|
command_buffer,
|
||||||
|
@ -167,7 +167,7 @@ bool vk_record_command_buffer(const VkCommandBuffer command_buffer, const uint32
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool vk_update_uniform_buffer(const size_t current_frame) {
|
bool update_uniform_buffer(const size_t current_frame) {
|
||||||
const VkExtent2D current_extent = vk_current_swapchain_extent();
|
const VkExtent2D current_extent = vk_current_swapchain_extent();
|
||||||
m_uniform_buffer_object.window_size.w = current_extent.width;
|
m_uniform_buffer_object.window_size.w = current_extent.width;
|
||||||
m_uniform_buffer_object.window_size.h = current_extent.height;
|
m_uniform_buffer_object.window_size.h = current_extent.height;
|
||||||
|
@ -395,12 +395,12 @@ bool vk_draw_frame(void) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
vk_update_uniform_buffer(m_current_frame);
|
update_uniform_buffer(m_current_frame);
|
||||||
|
|
||||||
vkResetFences(m_dev, 1, &m_in_flight_fences.data[m_current_frame]);
|
vkResetFences(m_dev, 1, &m_in_flight_fences.data[m_current_frame]);
|
||||||
|
|
||||||
vkResetCommandBuffer(m_command_buffers.data[m_current_frame], 0);
|
vkResetCommandBuffer(m_command_buffers.data[m_current_frame], 0);
|
||||||
if (!vk_record_command_buffer(m_command_buffers.data[m_current_frame], image_index)) {
|
if (!record_command_buffer(m_command_buffers.data[m_current_frame], image_index)) {
|
||||||
PTK_ERR("failed recording command buffer");
|
PTK_ERR("failed recording command buffer");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -457,14 +457,7 @@ bool vk_draw_frame(void) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vk_finish(void) {
|
void cleanup(void) {
|
||||||
vkDeviceWaitIdle(m_dev);
|
|
||||||
|
|
||||||
vk_cleanup();
|
|
||||||
vk_components_cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
void vk_cleanup(void) {
|
|
||||||
vk_cleanup_swapchain(m_dev);
|
vk_cleanup_swapchain(m_dev);
|
||||||
|
|
||||||
vkDestroyPipeline(m_dev, m_pipeline, NULL);
|
vkDestroyPipeline(m_dev, m_pipeline, NULL);
|
||||||
|
@ -507,3 +500,10 @@ void vk_cleanup(void) {
|
||||||
|
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vk_finish(void) {
|
||||||
|
vkDeviceWaitIdle(m_dev);
|
||||||
|
|
||||||
|
cleanup();
|
||||||
|
vk_components_cleanup();
|
||||||
|
}
|
||||||
|
|
|
@ -22,10 +22,4 @@ void vk_finish(void);
|
||||||
|
|
||||||
bool vk_transfer_vertex_data(void);
|
bool vk_transfer_vertex_data(void);
|
||||||
|
|
||||||
bool vk_record_command_buffer(const VkCommandBuffer command_buffer, const uint32_t image_index);
|
|
||||||
|
|
||||||
bool vk_update_uniform_buffer(const size_t current_frame);
|
|
||||||
|
|
||||||
void vk_cleanup(void);
|
|
||||||
|
|
||||||
#endif // PTK_PTK_VK_INIT_H_
|
#endif // PTK_PTK_VK_INIT_H_
|
||||||
|
|
Loading…
Reference in a new issue