Interface GPUProgrammableStage

    interface GPUProgrammableStage {
        constants?: Record<string, number>;
        entryPoint?: string;
        module: GPUShaderModule;
    }
    Hierarchy

    Properties

    constants?: Record<string, number>

    Specifies the values of pipeline-overridable constants in the shader module GPUProgrammableStage#module. Each such pipeline-overridable constant is uniquely identified by a single pipeline-overridable constant identifier string, representing the pipeline constant ID of the constant if its declaration specifies one, and otherwise the constant's identifier name. The key of each key-value pair must equal the pipeline-overridable constant identifier string|identifier string of one such constant, with the comparison performed according to the rules for WGSL identifier comparison. When the pipeline is executed, that constant will have the specified value. Values are specified as GPUPipelineConstantValue, which is a double. They are converted [$to WGSL type$] of the pipeline-overridable constant (bool/i32/u32/f32/f16). If conversion fails, a validation error is generated.

    entryPoint?: string

    The name of the function in GPUProgrammableStage#module that this stage will use to perform its work. NOTE: Since the GPUProgrammableStage#entryPoint dictionary member is not required, methods which consume a GPUProgrammableStage must use the "[$get the entry point$]" algorithm to determine which entry point it refers to.

    The GPUShaderModule containing the code that this programmable stage will execute.