le2d v0.4.3
2D game engine framework
 
Loading...
Searching...
No Matches
shader.hpp
Go to the documentation of this file.
1#pragma once
3#include <vulkan/vulkan.hpp>
4
5namespace le {
7class IShader : public IResource {
8 public:
9 using SpirV = std::span<std::uint32_t const>;
10
11 struct Modules {
12 vk::ShaderModule vertex{};
13 vk::ShaderModule fragment{};
14 };
15
16 [[nodiscard]] virtual auto load(SpirV vertex, SpirV fragment) -> bool = 0;
17
18 [[nodiscard]] virtual auto get_modules() const -> Modules = 0;
19 [[nodiscard]] virtual auto get_hash() const -> std::size_t = 0;
20};
21} // namespace le
Interface for all shared resources in the engine.
Definition resource.hpp:6
Opaque interface for a Shader program.
Definition shader.hpp:7
virtual auto get_hash() const -> std::size_t=0
virtual auto get_modules() const -> Modules=0
virtual auto load(SpirV vertex, SpirV fragment) -> bool=0
std::span< std::uint32_t const > SpirV
Definition shader.hpp:9
Definition animation.hpp:8
Definition shader.hpp:11
vk::ShaderModule vertex
Definition shader.hpp:12
vk::ShaderModule fragment
Definition shader.hpp:13