Engine → Renderer → shader_asset.h
shader_asset
| Type | Class |
| Namespace | conjure::renderer |
| Include File Path | engine/include/conjure/renderer/shader_asset.h |
| Source File Path | engine/src/renderer/assets/shader_asset.cpp |
| API ↗ | Rendering, Renderer assets |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | shader_asset(); | |
| public | explicit shader_asset(
shader_program_desc desc); | |
| public | shader_asset(
const shader_asset &) = default; | |
| public | shader_asset(
shader_asset &&) noexcept = default; |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~shader_asset(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mDesc | shader_program_desc | {} |
Functions
Public
built_in_programs
built_in_programs[[nodiscard]] static std::span<const shader_program_desc> built_in_programs() noexcept;Every program the renderer loads, one entry per shader permutation: the pass programs (pipeline variants that differ only in render state share an entry), the blit and the Dear ImGui backend's program. The ImGui entry is listed in every configuration but is loaded only by an editor build's renderer created with enableImGui and a swapchain.
desc
desc[[nodiscard]] const shader_program_desc &desc() const noexcept;find_built_in
find_built_in[[nodiscard]] static core::result<shader_asset> find_built_in(
std::string_view name,
std::string_view pixelDefines = {},
std::string_view vertexDefines = {});The built-in program with this name whose pixel and vertex define strings both equal the given ones ("" matches a stage without defines, it is not a wildcard), or core::error_code::NOT_FOUND naming all three.
validate
validate[[nodiscard]] core::result<void> validate(
rhi::shader_library &library) const;Succeeds when the library's index has a blob for its backend for every stage of the program (vertex, pixel, compute, in that order; a stage with an "" entry is skipped). Fails with renderer_error::SHADER_NOT_FOUND naming the first missing shader key. Reads the index only: a blob file that is listed but missing on disk is found when the renderer loads it, not here.
Operator Overloads
Public
operator=
operator=shader_asset &operator=(
const shader_asset &) = default;shader_asset &operator=(
shader_asset &&) noexcept = default;operator==
operator==[[nodiscard]] bool operator==(
const shader_asset &other) const noexcept = default;