Home -> IShaderProgram -> LoadShaderStage
Description
The LoadShaderStage method supplies shader source code or bytecode for one stage of an IShaderProgram. The code is stored on the shader program object and is not compiled, linked, reflected, or validated against other stages until CompileProgram is called.
The stage argument identifies where the code will run in the pipeline, while the ShaderSourceInfoBase derived object identifies the code format and any format-specific metadata, such as entry point names.
Important
Optional shader stages require matching device features. Geometry shaders require the GeometryShaders feature, and compute shaders require the ComputeShaders feature. The feature must be supported by the device and enabled when the renderer is created.
Usage
SuccessToken LoadShaderStage(ShaderStage stage, const ShaderSourceInfoBase& shaderSourceInfo);
Argument list
- stage [ShaderStage]
- The shader stage that the supplied code belongs to.
- shaderSourceInfo [const ShaderSourceInfoBase]
- The shader source or bytecode description for the supplied code format.
Return value
- [SuccessToken]
- True if the operation succeeded, false otherwise. An assertion will be raised in debug builds if the result is not tested.