Interface GPUShaderModuleDescriptor

Hierarchy

Properties

code: string

The WGSL source code for the shader module.

compilationHints?: GPUShaderModuleCompilationHint[]

A list of GPUShaderModuleCompilationHints. Any hint provided by an application should contain information about one entry point of a pipeline that will eventually be created from the entry point. Implementations should use any information present in the GPUShaderModuleCompilationHint to perform as much compilation as is possible within createShaderModule. Aside from type-checking, these hints are not validated in any way.

Supplying information in compilationHints does not have any observable effect, other than performance. It may be detrimental to performance to provide hints for pipelines that never end up being created. Because a single shader module can hold multiple entry points, and multiple pipelines can be created from a single shader module, it can be more performant for an implementation to do as much compilation as possible once in createShaderModule rather than multiple times in the multiple calls to () or createRenderPipeline. Hints are only applied to the entry points they explicitly name. Unlike GPUProgrammableStage#entryPoin | PUProgrammableStage.entryPoint, there is no default, even if only one entry point is present in the module.
Note: Hints are not validated in an observable way, but user agents **may** surface identifiable errors (like unknown entry point names or incompatible pipeline layouts) to developers, for example in the browser developer console.
label?: string

The initial value of GPUObjectBase#labe | PUObjectBase.label.

Generated using TypeDoc