textureNumSamples
On this page

textureNumSamples

Function

Returns the number of samples per texel of a texture_multisampled_2d or a texture_depth_multisampled_2d as a u32.

The signature and the sentence under each name are the compiler's own text at commit 26de7be8.

Syntax

declare function textureNumSamples<E extends TextureElem = f32>(
tex: texture_multisampled_2d<E> | texture_depth_multisampled_2d,
): u32

A signature may name a type the ambient file declares for its own use. These are those declarations.

TextureElem
type TextureElem = f32 | i32 | u32

Parameters

Return value

u32

Description

A single-sample texture is refused. Compiles to textureNumSamples on WGSL; GLSL ES 3.00 has no multisampled textures, so a module using it emits WGSL alone.

Targets

WGSL
textureNumSamples(a)
GLSL ES 3.00
textureNumSamples has no GLSL ES 3.00 spelling (textureSamples is ES 3.10)

Examples

See also

Edit this page Report a problem