Discard
On this page

Discard()

Function in Authoring

Push a discard; onto the innermost scope.

import { Discard } from 'typeshade/core/ir'

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

Syntax

const Discard: () => void

Return value

void

Description

Push a discard; onto the innermost scope. It ends the current fragment invocation with no color or depth write, the fragment-only terminator of both WGSL and GLSL. It is typically guarded by an If for a cull test: a backface, an alpha clip, an out-of-bounds sample.

Examples

Example

If(cosC.lt(0), () => {
Discard()
})

Source

src/core/ir/builder.ts, line 1488, at commit af54ddad5

Edit this page Report a problem