Skip to content

ludus::graphics::rhi::ShaderDescription

Ludus Wiki · API overview · Browse API

Struct

Per-target shader artifacts, borrowed only during CreateShader. Each backend consumes its own source/binary and explicit entry name. A browser build carries both WGSL and GLSL ES for startup selection.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

#include <ludus/graphics/rhi/render.h>
struct ludus::graphics::rhi::ShaderDescription final

Fields

Stage

ShaderStage ludus::graphics::rhi::ShaderDescription::Stage = ShaderStage::Vertex
Shader stage; the selected entry must have this stage.

Related types: ShaderStage

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

UniformSize

ludus::foundation::usize ludus::graphics::rhi::ShaderDescription::UniformSize = 0
Minimum occupied uniform bytes from the selected artifact's reflection.

Related types: ludus::foundation::usize

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

Spirv

std::span<const ludus::foundation::uint32> ludus::graphics::rhi::ShaderDescription::Spirv
Vulkan SPIR-V words.

Related types: ludus::foundation::uint32

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

Wgsl

std::string_view ludus::graphics::rhi::ShaderDescription::Wgsl
WebGPU WGSL source.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

GlslEs

std::string_view ludus::graphics::rhi::ShaderDescription::GlslEs = ""
WebGL 2 GLSL ES 3.00 source.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

SpirvEntry

std::string_view ludus::graphics::rhi::ShaderDescription::SpirvEntry
Entry in Spirv.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

WgslEntry

std::string_view ludus::graphics::rhi::ShaderDescription::WgslEntry
Entry in Wgsl.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

GlslEsEntry

std::string_view ludus::graphics::rhi::ShaderDescription::GlslEsEntry = ""
Entry in GlslEs (main).

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

Msl

std::string_view ludus::graphics::rhi::ShaderDescription::Msl = ""
Metal Shading Language 2.3 source, compiled at resource creation.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

MslEntry

std::string_view ludus::graphics::rhi::ShaderDescription::MslEntry = ""
Entry in Msl, independently verified against the compiled stage.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

Dxil

std::span<const ludus::foundation::uint8> ludus::graphics::rhi::ShaderDescription::Dxil = {}
Direct3D 12 DXIL container (shader model 6.0), as written by the pinned DXC.
The bytes are copied during CreateShader; the caller keeps them alive only for that call. The container must be signed by the DXIL validator, hold the program for Stage, and use at most one constant buffer at register b0, space 0.

Note

ludus_compile_shader emits DXIL only when CMake targets a Windows host.

Related types: ludus::foundation::uint8

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

DxilEntry

std::string_view ludus::graphics::rhi::ShaderDescription::DxilEntry = ""
Entry in Dxil, checked against the container's pipeline state validation part.
A container records one entry; a different name or stage fails CreateShader.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h

HasNativeRayStages

bool ludus::graphics::rhi::ShaderDescription::HasNativeRayStages = false
Native Metal ray stages and alpha intersection function, linked through immutable function tables. Compute stage only; unsupported APIs reject creation without substituting inline queries.

Declared in modules/graphics/rhi/include/ludus/graphics/rhi/render.h