From GLSL
On this page

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. WGSL vs GLSL ES 3.00 compiles one shader to both targets and lists where they differ.

How to read a row

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

This page maps one construct at a time. Migrating a GLSL shader covers what a whole GLSL ES 3.00 shader also carries: uniform blocks, #ifdef, #include and #extension. Each row there gives the "use typeshade" spelling. WGSL vs GLSL ES 3.00 compiles one shader to both targets, and the WGSL side of this page is WGSL in TypeShade.

Edit this page Report a problem