Skip to content

Engine → RHI

shader_library.h

Compiled shader blobs. conjure_add_shaders() writes <output>/index.json listing every permutation as { name, entry, stage, defines, dxil, spirv, sourceHash }; shader_library opens that index, selects the blob column for the device's backend (DXIL on D3D12, SPIR-V on Vulkan, whichever exists on the null device) and loads blobs lazily.

Structs

File Description
shader_blob
shader_key Identifies one permutation: the source file stem, the entry point and the define string in the axis order declared in CMake ("ALPHA_MASK=1", "A=1|B=0", "" for none).
shader_library::create_tag

Classes

File Description
shader_library

Enumerations

shader_stage

enum class shader_stage : u8 {
    VERTEX = 0,
    PIXEL,
    COMPUTE,
    COUNT
};

Forward Declarations

shader_library::impl

struct impl;

Functions

Public

parse_shader_stage

[[nodiscard]] CONJURE_API core::result<shader_stage> parse_shader_stage(
    std::string_view name) noexcept;

Parses "vertex" / "pixel" / "compute" (also the dxc profiles "vs", "ps", "cs"), case-insensitively. Fails with core::error_code::INVALID_ARGUMENT otherwise.

to_string

[[nodiscard]] CONJURE_API std::string_view to_string(
    shader_stage stage) noexcept;

The index.json spelling of a stage: "vertex", "pixel" or "compute"; "" for an out-of-range value.