38 enum class Type : uint32_t
41 SHADER_COMPUTE = VK_SHADER_STAGE_COMPUTE_BIT,
42 SHADER_VERTEX = VK_SHADER_STAGE_VERTEX_BIT,
43 SHADER_FRAGMENT = VK_SHADER_STAGE_FRAGMENT_BIT,
44 SHADER_GEOMETRY = VK_SHADER_STAGE_GEOMETRY_BIT
55 bool loadFromSpirVBuffer(
LogicalDevice const& logicalDevice, std::vector<uint32_t>
const& buffer, Type type);
56 bool loadFromFile(
LogicalDevice const& logicalDevice, std::filesystem::path
const& filepath, Type type);
60 [[nodiscard]] VkShaderModule getShaderModule()
const;
61 [[nodiscard]] VkPipelineShaderStageCreateInfo
const& getPipelineShaderStageCreateInfo()
const;
62 [[nodiscard]] Type getType()
const;
65 using ReflectBindings = std::vector<DescriptorSetLayout::Binding>;
66 using ReflectSets = std::map<uint32_t, ReflectBindings, std::less<>>;
68 void retrieveBindings(ReflectSets& buffer)
const;
69 [[nodiscard]] std::vector<VkPushConstantRange> retrievePushConstantRanges()
const;
77 VkShaderModule g_shaderModule;
78 VkPipelineShaderStageCreateInfo g_pipelineShaderStageCreateInfo;
79 Type g_type{Type::SHADER_NONE};
80 std::vector<uint32_t> g_spirvBuffer;
85 mutable std::vector<std::vector<DescriptorSetLayout::Binding>> g_reflectBindings;
86 mutable std::vector<VkPushConstantRange> g_reflectPushConstantRanges;