diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-02-16 22:26:33 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-02-16 22:26:33 +0100 |
| commit | 7de1a371e887865512312dc5937c6a3c6bf1299d (patch) | |
| tree | 885fcce047b7d4f6a4ce1d29135b0d332032ceee /include/vk-api.hpp | |
| parent | a51cbd463d328da70ca927c10680e0bdc3edfe02 (diff) | |
Attempt using imgui
Diffstat (limited to 'include/vk-api.hpp')
| -rw-r--r-- | include/vk-api.hpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/vk-api.hpp b/include/vk-api.hpp index ed8ff65..6534e3f 100644 --- a/include/vk-api.hpp +++ b/include/vk-api.hpp @@ -3,6 +3,7 @@ #include <vector> #include <optional> +#include <string> #include "vk-context.hpp" @@ -12,11 +13,11 @@ struct Buffer { void* mapped_ptr; }; -struct ComputePipeline { - VkShaderModule shader_module; - VkDescriptorSetLayout descriptor_set_layout; - VkPipelineLayout layout; - VkPipeline handle; +struct Pipeline { + std::vector<VkShaderModule> shader_modules; + VkDescriptorSetLayout descriptor_set_layout; + VkPipelineLayout layout; + VkPipeline handle; }; struct Image { @@ -69,8 +70,9 @@ class vkapi { void destroy_command_buffers(std::vector<VkCommandBuffer> &command_buffers); - ComputePipeline create_compute_pipeline(const char* shader_path, std::vector<VkDescriptorSetLayoutBinding> bindings); - void destroy_compute_pipeline(ComputePipeline &pipeline); + Pipeline create_compute_pipeline(std::string& shader_name, std::vector<VkDescriptorSetLayoutBinding> bindings); + Pipeline create_graphics_pipeline(std::string& shader_name, VkShaderStageFlagBits shader_stages, std::vector<VkDescriptorSetLayoutBinding> bindings); + void destroy_pipeline(Pipeline &pipeline); std::vector<VkDescriptorSet> create_descriptor_sets(VkDescriptorSetLayout descriptor_sets_layout, size_t descriptor_sets_count); @@ -105,6 +107,10 @@ class vkapi { vkcontext context; + private: + + std::string shader_stage_extension(VkShaderStageFlags shader_stage); + VkCommandPool command_pool; VkDescriptorPool descriptor_pool; |
