glslEs300Backend
On this page

glslEs300Backend

Constant in Emit

The GLSL ES 3.00 (WebGL2) Backend.

import { glslEs300Backend } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

const glslEs300Backend: Backend

Description

The GLSL ES 3.00 (WebGL2) Backend. It supplies the GLSL spelling of types, literals, intrinsics and declarations to the shared emitter, which walks a module’s control flow the same way for every target. emitGlslModule, emitGlslStages and emitGlslFragment drive it; pass it to a function that takes a Backend when you need GLSL spelling for a single construct.

Everything GLSL ES 3.00 cannot express throws UnsupportedFeatureError (SD0030) before any source is produced: a @compute entry that is not declared portable, a multisampled (2d-ms) texture load, f16, subgroups, a standalone sampler binding (GLSL has only the combined sampler2D), and a vertex entry that returns a bare non-struct output (GLSL links inter-stage varyings by field name, so the output must be a struct whose field the fragment input shares). A storage binding does not throw: emitGlslModule rewrites it to a data-texture read first, and only the shapes that rewrite cannot cover throw, such as a read_write storage binding or an unsupported element type.

See also

Source

src/core/backends/glsl.ts, line 557, at commit 26de7be8

Edit this page Report a problem