25 Attachment(uint32_t binding, std::string name, Type type,
bool multisampled =
false,
const Color& clear_colour = Color::black,
26 bool shader_readable =
false,
bool shadow_sampler =
false)
28 , name_(std::move(name))
30 , multisampled_(multisampled)
31 , clear_color_(clear_colour)
32 , shader_readable_(shader_readable)
33 , shadow_sampler_(shadow_sampler)
37 uint32_t GetBinding()
const
41 const std::string& GetName()
const
49 bool IsMultisampled()
const
53 const Color& GetClearColour()
const
57 bool IsShaderReadable()
const
59 return shader_readable_;
61 bool UsesShadowSampler()
const
63 return shadow_sampler_;
72 bool shader_readable_;
79 SubpassType(uint32_t binding, std::vector<uint32_t> attachment_bindings)
81 , attachment_bindings_(std::move(attachment_bindings))
85 uint32_t GetBinding()
const
89 const std::vector<uint32_t>& GetAttachmentBindings()
const
91 return attachment_bindings_;
96 std::vector<uint32_t> attachment_bindings_;
102 Viewport() =
default;
104 explicit Viewport(
const glm::uvec2& size)
109 const glm::vec2& GetScale()
const
113 void SetScale(
const glm::vec2& scale)
118 const std::optional<glm::uvec2>& GetSize()
const
122 void SetSize(
const std::optional<glm::uvec2>& size)
127 const glm::ivec2& GetOffset()
const
131 void SetOffset(
const glm::ivec2& offset)
137 glm::vec2 scale_{ 1.0f, 1.0f };
138 std::optional<glm::uvec2> size_;
139 glm::ivec2 offset_{ 0, 0 };
145 explicit RenderStage(std::vector<Attachment> images = {}, std::vector<SubpassType> subpasses = {},
149 std::optional<Attachment> GetAttachment(
const std::string& name)
const;
150 std::optional<Attachment> GetAttachment(uint32_t binding)
const;
152 const std::vector<Attachment>& GetAttachments()
const
156 const std::vector<SubpassType>& GetSubpasses()
const
169 void SetViewport(
const Viewport& viewport)
171 viewport_ = viewport;
175 std::vector<Attachment> attachments_;
176 std::vector<SubpassType> subpasses_;