From WGSL
On this page

WGSL in TypeShade

A reader who already writes WGSL needs one thing from this site, which is the TypeShade spelling of the construct in front of them. This page reads in that direction: a WGSL form on the left, what to write in a "use typeshade" file on the right, and a note where the two do not line up.

How to read a row

The right column is source text the compiler at commit 26de7be8 accepts, and the left column is the WGSL that same compiler writes for it. Both are measured when this page is built, so a spelling the compiler stops writing arrives here at the next pin as a changed row.

Sections

Types
The WGSL type surface with the TypeShade spelling of each one: scalars, vectors, matrices, arrays and atomics, textures and samplers.
Resources and address spaces
A resource is a declare, the address space and the access mode are the wrapper type on the annotation, and the slot index is the source order.
Entry points and attributes
Stage attributes, workgroup size, what a vertex entry has to return, the builtin ids the pipeline supplies, and the names WGSL does not have.
Statements and expressions
The statements are TypeScript, and each one means what the WGSL beside it means. The text comes from one file compiled while this page is built.

Builtin functions

Every builtin the compiler can spell, with the WGSL text it writes for each one, is on the builtin table. A function the file declares wins over a builtin of the same name.

Edit this page Report a problem