3#include "spark/render/Export.h"
4#include "spark/render/Pipeline.h"
5#include "spark/render/ShaderStages.h"
11namespace spark::render
26 [[nodiscard]]
virtual ShaderStage
stage() const noexcept = 0;
32 [[nodiscard]] virtual const std::
string& fileName() const noexcept = 0;
38 [[nodiscard]] virtual const std::
string& entryPoint() const noexcept = 0;
53 [[nodiscard]] std::vector<const IShaderModule*>
shaders() const noexcept {
return genericShaders(); }
68 [[nodiscard]]
virtual std::vector<const IShaderModule*> genericShaders() const noexcept = 0;
75 template <typename ShaderModuleType>
79 using shader_module_type = ShaderModuleType;
83 [[nodiscard]]
virtual std::vector<const shader_module_type*>
shaders() const noexcept = 0;
86 [[nodiscard]] std::vector<const
IShaderModule*> genericShaders() const noexcept final
89 std::vector<const IShaderModule*> result;
90 result.reserve(tmp.size());
91 std::ranges::transform(tmp, std::back_inserter(result), [](
const auto& shader) {
return static_cast<const IShaderModule*
>(shader); });
Interface representing a single shader module, a part of a IShaderProgram.
Definition Shader.h:18
virtual ShaderStage stage() const noexcept=0
Gets the type of the shader.
Interface representing a shader program, a collection of IShaderModule.
Definition Shader.h:45
virtual std::shared_ptr< IPipelineLayout > reflectPipelineLayout() const =0
Uses shader reflexion to extract the pipeline layout from this shader program.
std::vector< const IShaderModule * > shaders() const noexcept
Gets all shaders contained in this program.
Definition Shader.h:53
Represents a shader program with a specific type of IShaderModule.
Definition Shader.h:77
virtual std::vector< const shader_module_type * > shaders() const noexcept=0
Gets all shaders contained in this program.