skeleton for the pipeline complete
This commit is contained in:
2
src/vulkan_engine.cpp
Normal file
2
src/vulkan_engine.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "vulkan_engine.hpp"
|
||||
|
||||
60
src/vulkan_engine.hpp
Normal file
60
src/vulkan_engine.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <sys/types.h>
|
||||
#include <vulkan/vulkan_core.h>
|
||||
class VulkanEngine{
|
||||
public:
|
||||
void init();
|
||||
void run();
|
||||
void cleanup();
|
||||
private:
|
||||
|
||||
VkInstance _instance;
|
||||
VkDebugUtilsMessengerEXT _debug_messenger;
|
||||
VkPhysicalDevice _chosen_device;
|
||||
VkDevice _device;
|
||||
|
||||
VkQueue _graphics_queue;
|
||||
VkQueue _compute_queue;
|
||||
VkQueue _video_queue;
|
||||
|
||||
uint32_t _graphics_queue_family;
|
||||
uint32_t _compute_queue_family;
|
||||
uint32_t _video_queue_family;
|
||||
|
||||
VkCommandPool _graphics_command_pool;
|
||||
VkCommandPool _compute_command_pool;
|
||||
VkCommandPool _video_command_pool;
|
||||
|
||||
struct Frame{
|
||||
VkCommandBuffer graphics_comm_buf;
|
||||
VkCommandBuffer compute_comm_buf;
|
||||
VkCommandBuffer video_comm_buff;
|
||||
VkSemaphore timeline;
|
||||
uint64_t timeline_value;
|
||||
};
|
||||
|
||||
static constexpr uint32_t FRAME_OVERLAP = uint32_t{3};
|
||||
Frame _frames[FRAME_OVERLAP];
|
||||
uint64_t _frame_number = uint64_t {0};
|
||||
|
||||
VkImage _render_image;
|
||||
VkImageView _render_view;
|
||||
|
||||
VkImage _yuv_image;
|
||||
VkImageView _yuv_image_view;
|
||||
|
||||
VkVideoSessionKHR _video_session;
|
||||
VkVideoSessionParametersKHR _video_session_params;
|
||||
VkVideoEncodeInfoKHR _encode_info;
|
||||
|
||||
VkBuffer _bitstream_buffer;
|
||||
private:
|
||||
void init_vulkan();
|
||||
void init_device();
|
||||
void init_commands();
|
||||
void init_images();
|
||||
void init_video();
|
||||
void init_sync();
|
||||
};
|
||||
Reference in New Issue
Block a user