Skip to content

LiteFX::Rendering::ShaderRecordCollection::withShaderRecord

Adds a new shader record based on the name of a shader module in the parent shader program.

Synopsis

Declared in <litefx/rendering_api.hpp>

template<typename TLocalData>
requires (std::alignment_of_v<TLocalData> == SHADER_RECORD_LOCAL_DATA_ALIGNMENT)
ShaderRecordCollection&& withShaderRecord(
    StringView shaderName,
    TLocalData payload);

Description

Note that this will create a new shader record for every invocation. If you want to create a shader record with a mesh geometry hit group with containing both, an any and closest hit shader, use withMeshGeometryHitGroupRecord instead.

Return Value

A reference to the current shader record collection.

Template Parameters

NameDescription
TLocalDataThe type of the shader record local data.

Parameters

NameDescription
payloadThe shader-local data of the shader record.