diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-01-26 23:12:49 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-01-26 23:12:49 +0100 |
| commit | 1314f696a7861f3b1509c7f5c27d6b06bc22d5f1 (patch) | |
| tree | dc438e1fe4f9c5503f984c00cac190a2cdb6268f /include/vk-renderer.hpp | |
| parent | d3b08c7e8bf808281e32fdef5e5222fb6633a5d0 (diff) | |
Split vkinstance/vkdevice of renderer into context class
Diffstat (limited to 'include/vk-renderer.hpp')
| -rw-r--r-- | include/vk-renderer.hpp | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/include/vk-renderer.hpp b/include/vk-renderer.hpp index 5f70718..c13f029 100644 --- a/include/vk-renderer.hpp +++ b/include/vk-renderer.hpp @@ -3,12 +3,11 @@ #include <vector> +#include "vk-context.hpp" #include "vulkan-loader.hpp" -#include "thirdparty/vk_mem_alloc.h" - -#include "window.hpp" class input_data; +class window; class vkrenderer { public: @@ -16,27 +15,19 @@ class vkrenderer { ~vkrenderer(); - void compute(); + void compute(uint32_t width, uint32_t height); void recreate_swapchain(); struct input_data* mapped_data; private: - void create_instance(); - - void create_debugger(); - - void create_surface(); - - void create_device(); + void create_surface(window& wnd); void create_swapchain(); void create_pipeline(); - void create_memory_allocator(); - void create_command_buffers(); void create_descriptor_sets(); @@ -47,14 +38,8 @@ class vkrenderer { void create_input_buffer(const input_data& inputs); - void destroy_instance(); - - void destroy_debugger(); - void destroy_surface(); - void destroy_device(); - void destroy_swapchain(); void destroy_swapchain_images(); @@ -63,8 +48,6 @@ class vkrenderer { void destroy_command_buffers(); - void destroy_allocator(); - void destroy_descriptor_sets(); void destroy_fences(); @@ -73,28 +56,16 @@ class vkrenderer { void destroy_input_buffer(); - void select_physical_device(); - - void select_compute_queue(); - void update_descriptors_buffer(); void update_descriptors_image(); void handle_swapchain_result(VkResult function_result); - uint32_t compute_queue_index; - uint64_t frame_index = 0; - - VkInstance instance; - - VkDebugUtilsMessengerEXT debugMessenger; + vkcontext context; - VkPhysicalDevice physical_device; - VkDevice device; - VkQueue compute_queue; + uint64_t frame_index = 0; - VmaAllocator allocator; VmaAllocation allocation; VkBuffer compute_shader_buffer; @@ -120,8 +91,6 @@ class vkrenderer { std::vector<VkImage> swapchain_images; std::vector<VkImageView> swapchain_images_views; uint32_t current_image_index; - - window& wnd; }; #endif // !__VK_RENDERER_HPP_ |
