Interface GPUShaderModuleDescriptor



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 createComputePipeline or createRenderPipeline.
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.

sourceMap?: any

If defined MAY be interpreted as a source-map-v3 format. Source maps are optional, but serve as a standardized way to support dev-tool integration such as source-language debugging WGSL names (identifiers) in source maps follow the rules defined in WGSL identifier comparison.

Generated using TypeDoc