shader_module.hpp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once


#include <planet/vk/helpers.hpp>


namespace planet::vk {


    class device;


    class shader_module final {
        using handle_type =
                device_handle<VkShaderModule, vkDestroyShaderModule>;
        handle_type handle;

        std::vector<std::byte> spirv;

      public:
        shader_module(vk::device &, std::vector<std::byte>);

        device_view device;
        VkShaderModule get() const noexcept { return handle.get(); }

Fill in the structure from the shader module

27
28
29
30
31
32
        VkPipelineShaderStageCreateInfo
                shader_stage_info(VkShaderStageFlagBits, char const *);
    };


}