2#include <vulkan-cpp/shader_resource.hpp>
3#include <core/core.hpp>
4#include <unordered_map>
33 const ::vk::shader_resource_info& p_info);
39 [[nodiscard]]
bool valid()
const {
return m_resource_valid; }
49 std::span<const ::vk::vertex_attribute> p_attributes);
63 [[nodiscard]] std::vector<::vk::shader_handle>
handles()
const {
64 return map_to_vector();
70 [[nodiscard]] std::span<const VkVertexInputAttributeDescription>
72 return m_vertex_attributes;
78 [[nodiscard]] std::span<const VkVertexInputBindingDescription>
80 return m_vertex_binding_attributes;
99 return m_reload_requested;
107 [[nodiscard]] std::vector<::vk::shader_handle> map_to_vector()
const;
109 void create_module(std::span<char> p_blob,
110 const ::vk::shader_source& p_source);
112 void create_module(std::span<uint32_t> p_blob,
113 const ::vk::shader_source& p_source);
115 void reload_shader(const ::vk::shader_source& p_source);
118 VkDevice m_device =
nullptr;
119 std::vector<VkVertexInputAttributeDescription> m_vertex_attributes;
120 std::vector<VkVertexInputBindingDescription>
121 m_vertex_binding_attributes;
122 bool m_resource_valid =
false;
124 std::unordered_map<std::string, ::vk::shader_handle> m_modules;
126 bool m_reload_requested =
false;
resource group for loading shader sources that give you back VkShaderModule handles
Definition shader_resource_group.hpp:21
std::span< const VkVertexInputAttributeDescription > vertex_attributes() const
Definition shader_resource_group.hpp:71
void vertex_attributes(std::span< const ::vk::vertex_attribute > p_attributes)
sets the vertex attributes with the shader modules that gets used by ::vk::pipeline (graphics pipelin...
shader_resource_group(const VkDevice &p_device, const ::vk::shader_resource_info &p_info)
constructs a new shader_resource_group
void destroy()
explicit cleanup to the VkShaderModule handles created with this particular resource group
bool valid() const
Definition shader_resource_group.hpp:39
bool reload_requested() const
ideally used for requesting for reload
Definition shader_resource_group.hpp:98
std::span< const VkVertexInputBindingDescription > vertex_bind_attributes() const
Definition shader_resource_group.hpp:79
std::vector<::vk::shader_handle > handles() const
this gives you back the shader module handles along with each of their stages they have been compiled...
Definition shader_resource_group.hpp:63