SetShaderValue

Sets the value of a shader parameter.

Choose your operating system:

Windows

macOS

Linux

References

Module

RenderCore

Header

/Engine/Source/Runtime/RenderCore/Public/ShaderParameterUtils.h

Include

#include "ShaderParameterUtils.h"

Syntax

template<typename ShaderRHIParamRef, class ParameterType, typename TRHICmdList>
void SetShaderValue
(
    TRHICmdList & RHICmdList,
    const ShaderRHIParamRef & Shader,
    const FShaderParameter & Parameter,
    const ParameterType & Value,
    uint32 ElementIndex
)

Remarks

Sets the value of a shader parameter. Template'd on shader type A template parameter specified the type of the parameter value.

Shader should be the param ref type, NOT the param type, since Shader is passed by value. Otherwise AddRef/ReleaseRef will be called many times.