Skip to content

getShaderStage

const getShaderStage: TgpuComptime<() => ShaderStage | undefined>

Defined in: packages/typegpu/src/std/environment.ts:75

Can be used to change behavior based on which shader stage the code is being used in. If used in a ‘use gpu’ function, its definition will be duplicated for each shader stage.

When called outside of shader resolution, or when the shader stage cannot be determined, undefined is returned.