wesl

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Stdout io.Writer = nil

Functions

This section is empty.

Types

type Files

type Files map[string]string

Files describe an in-memory file system that contains all files available to the transpiler.

func FilesOf

func FilesOf(fsys fs.FS) (Files, error)

type Options

type Options struct {
	// Files to present to the wesl transpiler
	Files Files

	// Constants to inject into the transpiler.
	// Value must be either int, float32 or string
	Constants map[string]any

	// Conditions for @if etc
	Conditions map[string]bool

	// PackageName for the local sources (in addition to default "package::").
	// Enables imports like `import mypkg::foo` alongside `import package::foo`.
	// Should be a valid WGSL identifier (use underscores, not hyphens or slashes).
	PackageName string
}

type Transpiler

type Transpiler struct {
	// contains filtered or unexported fields
}

func New

func New() *Transpiler

func (*Transpiler) Transpile

func (t *Transpiler) Transpile(entrypoint string, opts Options) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL