WgslValidator
On this page

WgslValidator

Interface in Variants

The slice of GPUDevice that validating a WGSL module needs.

import type { WgslValidator } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

interface WgslValidator<Module = unknown> {
createShaderModule(descriptor: { code: string }): Module;
}

Description

A real GPUDevice satisfies this as-is: pass it straight in. The interface is structural for the same two reasons as GlLinker: the package builds without WebGPU type definitions, and a test can drive the result aggregation with a recorder while the real run goes through the browser’s WGSL compiler.

Instance methods

createShaderModule (descriptor: { code: string }): Module

See also

Source

src/core/variant-link.ts, line 181, at commit 26de7be8

Edit this page Report a problem