From WGSL
On this page

WGSL in TypeShade

If you already write WGSL, this page shows how to express each construct in TypeShade. The left column shows the WGSL form; the right shows what to write in a "use typeshade" file. Notes explain where the two differ. WGSL vs GLSL ES 3.00 compiles one shader for both targets and describes their differences.

How to read a row

The right column is source text the compiler at commit af54ddad5 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