GLSL ES 3.00 in TypeShade
A shader written for WebGL2 is written in GLSL ES 3.00, and most of it has a TypeShade spelling that emits the same program for both targets. This page reads in that direction, and it says which constructs have no form on WebGPU and which ones the compiler refuses on both.
How to read a row
The right column is source text the compiler at commit 26de7be8 accepts, and the left column is the GLSL ES 3.00 that same compiler writes for it. Where this target has no form for a row, the cell carries the compiler's own sentence about it instead of a spelling it never writes.
Sections
- Types
- The GLSL ES 3.00 type surface with the TypeShade spelling of each one: scalars, vectors, matrices, arrays, samplers, and the types this target refuses.
- Uniforms and buffers
- A uniform binding is a struct the writer emits as a block, a varying is a field on both sides, and each capability this target knows is one row.
- Builtin variables
- A gl_ global is a builtin attribute on a parameter, on a class field or on the return, and the writer decides which global that becomes.
- Functions and operators
- A call carries one neutral name and each backend writes its own spelling. The derivative, texture, bit and remainder forms a GLSL author looks for.
The fn() spelling
This page is the "use typeshade" surface. The compiler also has an embedded surface, built out of fn() and uniformStruct() and their kin, and the same GLSL constructs are put against that spelling in Migrating a GLSL shader. The WGSL side of this page is WGSL in TypeShade.